mirror of
https://github.com/apache/httpd.git
synced 2026-01-06 09:01:14 +03:00
mod_cache: Per RFC 7234 section 5.3 an invalid
Expires header value must be interpreted as a time in the past. So apply the logic concerning "CacheStoreExpired" and "max-age" and "s-maxage" handling, which we are already using for a valid Expires header containing a time in the past, also to the case of an invalid Expires header. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1833876 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
7
modules/cache/mod_cache.c
vendored
7
modules/cache/mod_cache.c
vendored
@@ -1040,8 +1040,11 @@ static apr_status_t cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in)
|
||||
if (reason) {
|
||||
/* noop */
|
||||
}
|
||||
else if (exps != NULL && exp == APR_DATE_BAD) {
|
||||
/* if a broken Expires header is present, don't cache it */
|
||||
else if (!control.s_maxage && !control.max_age && !dconf->store_expired
|
||||
&& exps != NULL && exp == APR_DATE_BAD) {
|
||||
/* if a broken Expires header is present, don't cache it
|
||||
* Unless CC: s-maxage or max-age is present
|
||||
*/
|
||||
reason = apr_pstrcat(p, "Broken expires header: ", exps, NULL);
|
||||
}
|
||||
else if (!control.s_maxage && !control.max_age
|
||||
|
||||
Reference in New Issue
Block a user