Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293333

HTTP header date formats

$
0
0

Problem/Motivation

Drupal is using gmdate to generate the Last-Modified header in RFC1123 format.
gmdate(DATE_RFC1123, ... Resulting in code matching the following example.
Last-Modified: Tue, 12 Feb 2013 14:35:43 +0000
This is a valid rfc1123 date, however rfc2616 specifies a specific subset of RFC1123 for header dates which this does not conform to. Specifically, dates must be formated using "GMT" instead of "+0000".

Some software can't handle the none standard syntax with at least squid-3.1.10 printing messages like:
cannot parse hdr field: 'Last-Modified: Tue, 12 Feb 2013 14:35:43 +0000'
and refusing to cache the page.

Proposed resolution

Replacing DATE_RFC1123 dates in headers with a custom, correctly formatted format string.

Remaining tasks

User interface changes

API changes

Original report by @0x534B41

Drupal is using gmdate to generate the Last-Modified header in RFC1123 format.
gmdate(DATE_RFC1123, ...
At least with php-5.3.3 the generated header is like the following:
Last-Modified: Tue, 12 Feb 2013 14:35:43 +0000
Note the "+0000" part. This seems to be valid by rfc1123 but all the examples in rfc2616 use "GMT" instead of "+0000".
And it looks like some HTTP software can't handle the +0000 syntax. At least squid-3.1.10 is printing messages like:
cannot parse hdr field: 'Last-Modified: Tue, 12 Feb 2013 14:35:43 +0000'
and refusing to cache the page.
Other HTTP software (browsers, caches) may or may not have this issue (haven't tested yet).
Replacing DATE_RFC1123 with DATE_RFC850 in gmdate function call "resolves" the issue with squid.


Viewing all articles
Browse latest Browse all 293333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>