Page MenuHomePhabricator

"Expires: -1" HTTP header not strictly RFC valid
Closed, ResolvedPublic


Author: nickpj

"HTTP lint" of a MediaWiki 1.5.6 install gives one error for the HTTP headers,


  1. Expires: -1[0d][0a]
    • Error: Failed to parse this date. Dates should be in the RFC 1123 format. -----------------------

Appears to originate from includes/OutputPage.php :

[holt]$ grep -inr "Expires:" *
includes/OutputPage.php:387: header( "Expires: -1" );
includes/OutputPage.php:396: header( 'Expires: -1' );


The RFCs ( ) say:
"The format is an absolute date and time as defined by HTTP-date in section
3.3.1; it MUST be in RFC 1123 date format."

They also say: HTTP/1.1 clients and caches MUST treat other invalid date
formats, especially including the value "0", as in the past (i.e., "already

So, "-1" gets treated as invalid (and thus gets treated as being in the past).
The RFC suggests it would be more correct to instead give a date sometime in the
past, in RFC 1123 format.

Version: 1.5.x
Severity: minor



Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:09 PM
bzimport set Reference to bz5315.
bzimport added a subscriber: Unknown Object (MLST).

fixed in trunk@13892 , REL1_6@.

Will be in 1.6.4.