aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/fetch
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2018-05-12 17:04:40 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2018-05-12 17:04:40 +0000
commitdeb1ff232df5fc7bfc456c708a23e7c3e9b5aba5 (patch)
tree1206270242f7c0bb18f84d1af17807c98019033a /usr.bin/fetch
parentb847b083a865fc2ace237bb9d7aec1f6a7b916b1 (diff)
downloadsrc-deb1ff232df5fc7bfc456c708a23e7c3e9b5aba5.tar.gz
src-deb1ff232df5fc7bfc456c708a23e7c3e9b5aba5.zip
Support If-Modified-Since for https as well as http.
PR: 224426 Submitted by: zsnafzig@edu.uwaterloo.ca MFC after: 1 week
Notes
Notes: svn path=/head/; revision=333572
Diffstat (limited to 'usr.bin/fetch')
-rw-r--r--usr.bin/fetch/fetch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c
index a37821f5f809..2fb56aef8d3e 100644
--- a/usr.bin/fetch/fetch.c
+++ b/usr.bin/fetch/fetch.c
@@ -552,9 +552,10 @@ fetch(char *URL, const char *path)
goto signal;
if (f == NULL) {
warnx("%s: %s", URL, fetchLastErrString);
- if (i_flag && strcmp(url->scheme, SCHEME_HTTP) == 0
- && fetchLastErrCode == FETCH_OK
- && strcmp(fetchLastErrString, "Not Modified") == 0) {
+ if (i_flag && (strcmp(url->scheme, SCHEME_HTTP) == 0 ||
+ strcmp(url->scheme, SCHEME_HTTPS) == 0) &&
+ fetchLastErrCode == FETCH_OK &&
+ strcmp(fetchLastErrString, "Not Modified") == 0) {
/* HTTP Not Modified Response, return OK. */
r = 0;
goto done;