From 5771564c9cabe33c4356aefa115341b984937dad Mon Sep 17 00:00:00 2001 From: hniksic Date: Tue, 24 May 2005 07:16:27 -0700 Subject: [PATCH] [svn] Document the origin of the "cookie date" format. --- src/ChangeLog | 5 +++++ src/http.c | 13 +++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e4e83e5c..c44111fa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-05-24 Hrvoje Niksic + + * http.c (http_atotm): Document the origin of the "cookie date" + format. + 2005-05-21 Hrvoje Niksic * init.c (setval_internal): Report exact command name alongside diff --git a/src/http.c b/src/http.c index d549012c..357a0400 100644 --- a/src/http.c +++ b/src/http.c @@ -2596,8 +2596,9 @@ check_end (const char *p) /* Convert the textual specification of time in TIME_STRING to the number of seconds since the Epoch. - TIME_STRING can be in any of the three formats RFC2068 allows the - HTTP servers to emit -- RFC1123-date, RFC850-date or asctime-date. + TIME_STRING can be in any of the three formats RFC2616 allows the + HTTP servers to emit -- RFC1123-date, RFC850-date or asctime-date, + as well as the time format used in the Set-Cookie header. Timezones are ignored, and should be GMT. Return the computed time_t representation, or -1 if the conversion @@ -2631,10 +2632,10 @@ http_atotm (const char *time_string) static const char *time_formats[] = { "%a, %d %b %Y %T", /* rfc1123: Thu, 29 Jan 1998 22:12:57 */ "%A, %d-%b-%y %T", /* rfc850: Thursday, 29-Jan-98 22:12:57 */ - "%a, %d-%b-%Y %T", /* rfc850+: Thu, 29-Jan-1998 22:12:57 - (post-y2k-rfc850; apparently google - uses this for their cookies.) */ - "%a %b %d %T %Y" /* asctime: Thu Jan 29 22:12:57 1998 */ + "%a %b %d %T %Y", /* asctime: Thu Jan 29 22:12:57 1998 */ + "%a, %d-%b-%Y %T" /* cookies: Thu, 29-Jan-1998 22:12:57 + (used in Set-Cookie, defined in the + Netscape cookie specification.) */ }; int i; -- 2.39.2