Support If-Modified-Since for https as well as http.

PR:		224426
Submitted by:	zsnafzig@edu.uwaterloo.ca
MFC after:	1 week
This commit is contained in:
Dag-Erling Smørgrav 2018-05-12 17:04:40 +00:00
parent b847b083a8
commit deb1ff232d

View File

@ -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;