From deb1ff232df5fc7bfc456c708a23e7c3e9b5aba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sat, 12 May 2018 17:04:40 +0000 Subject: [PATCH] Support If-Modified-Since for https as well as http. PR: 224426 Submitted by: zsnafzig@edu.uwaterloo.ca MFC after: 1 week --- usr.bin/fetch/fetch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index a37821f5f80..2fb56aef8d3 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;