diff options
author | David Rothstein <drothstein@gmail.com> | 2014-11-04 22:44:01 -0500 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2014-11-04 22:44:01 -0500 |
commit | df8de735c3b998af03fc34c493661e2f7c4019b0 (patch) | |
tree | 7ef325b8c3daf1db9a83dac55f70a4b39a61dd33 /includes/bootstrap.inc | |
parent | 9559160204f1c4e72e145cf95d61bf61e4bd1fcf (diff) | |
download | brdo-df8de735c3b998af03fc34c493661e2f7c4019b0.tar.gz brdo-df8de735c3b998af03fc34c493661e2f7c4019b0.tar.bz2 |
Issue #1918820 by neclimdul, typhonius, girishmuraly, pwolanin | 0x534B41: Fixed HTTP header date formats to follow RFC 7231 rather than RFC 1123.
Diffstat (limited to 'includes/bootstrap.inc')
-rw-r--r-- | includes/bootstrap.inc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 862fede1c..6516db0ff 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -249,6 +249,15 @@ define('REGISTRY_WRITE_LOOKUP_CACHE', 2); define('DRUPAL_PHP_FUNCTION_PATTERN', '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'); /** + * A RFC7231 Compliant date. + * + * http://tools.ietf.org/html/rfc7231#section-7.1.1.1 + * + * Example: Sun, 06 Nov 1994 08:49:37 GMT + */ +define('DATE_RFC7231', 'D, d M Y H:i:s \G\M\T'); + +/** * Provides a caching wrapper to be used in place of large array structures. * * This class should be extended by systems that need to cache large amounts @@ -1266,7 +1275,7 @@ function drupal_page_header() { $default_headers = array( 'Expires' => 'Sun, 19 Nov 1978 05:00:00 GMT', - 'Last-Modified' => gmdate(DATE_RFC1123, REQUEST_TIME), + 'Last-Modified' => gmdate(DATE_RFC7231, REQUEST_TIME), 'Cache-Control' => 'no-cache, must-revalidate, post-check=0, pre-check=0', 'ETag' => '"' . REQUEST_TIME . '"', ); @@ -1336,7 +1345,7 @@ function drupal_serve_page_from_cache(stdClass $cache) { drupal_add_http_header($name, $value); } - $default_headers['Last-Modified'] = gmdate(DATE_RFC1123, $cache->created); + $default_headers['Last-Modified'] = gmdate(DATE_RFC7231, $cache->created); // HTTP/1.0 proxies does not support the Vary header, so prevent any caching // by sending an Expires date in the past. HTTP/1.1 clients ignores the |