summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2014-03-19 00:53:24 +0000
committerbdrewery <bdrewery@FreeBSD.org>2014-03-19 00:53:24 +0000
commit109ba62b9599b1906a20f36c7810041e1a1e0e13 (patch)
tree3906bc392f5f6382653afee7a1a95e490c67c14f
parentad70c4103e84f504930151e4d7bf3c71e3c2bd9d (diff)
downloadFreeBSD-src-109ba62b9599b1906a20f36c7810041e1a1e0e13.zip
FreeBSD-src-109ba62b9599b1906a20f36c7810041e1a1e0e13.tar.gz
MFC r263021:
Support Last-Modified behind proxies which return UTC instead of GMT.
-rw-r--r--lib/libfetch/http.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index b2feedb..cbbb8a8 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -876,6 +876,12 @@ http_parse_mtime(const char *p, time_t *mtime)
strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale));
setlocale(LC_TIME, "C");
r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm);
+ /*
+ * Some proxies use UTC in response, but it should still be
+ * parsed. RFC2616 states GMT and UTC are exactly equal for HTTP.
+ */
+ if (r == NULL)
+ r = strptime(p, "%a, %d %b %Y %H:%M:%S UTC", &tm);
/* XXX should add support for date-2 and date-3 */
setlocale(LC_TIME, locale);
if (r == NULL)
OpenPOWER on IntegriCloud