mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 15:12:44 +00:00
MFC r263021:
Support Last-Modified behind proxies which return UTC instead of GMT.
This commit is contained in:
parent
dd16a36b7d
commit
3186b95e0a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=263325
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user