PR 16521 states that mod_cache caches and returns responses that have an invalid Expires header (value is 0 or yesterday). The attached patch resolves this issue.
Some explanation:
- when apr_date_parse_http returns APR_DATE_BAD, the local variable containing the expires header was reset to NULL;
- the check a bit lower in the code:
if (exps != NULL && exp == APR_DATE_BAD) {
would always fail because when exp equals APR_DATE_BAD, exps was always NULL.
--
Index: modules/experimental/mod_cache.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/modules/experimental/mod_cache.c,v retrieving revision 1.74 diff -u -r1.74 mod_cache.c --- modules/experimental/mod_cache.c 15 May 2003 17:52:58 -0000 1.74 +++ modules/experimental/mod_cache.c 9 Jun 2003 13:15:48 -0000 @@ -480,9 +480,7 @@ */ exps = apr_table_get(r->headers_out, "Expires"); if (exps != NULL) { - if (APR_DATE_BAD == (exp = apr_date_parse_http(exps))) { - exps = NULL; - } + exp = apr_date_parse_http(exps); } else { exp = APR_DATE_BAD;