summaryrefslogtreecommitdiffstats
path: root/modules/cache
diff options
context:
space:
mode:
authorRainer Jung <rjung@apache.org>2018-06-20 00:40:19 +0200
committerRainer Jung <rjung@apache.org>2018-06-20 00:40:19 +0200
commit7bb2bf1e65fd37bc9b06a18a1132ed4ac6798b11 (patch)
treeb91639137bc9a544ce3b0bb617e12ef6080d34b9 /modules/cache
parentmod_ratelimit: fix behavior with proxied content (diff)
downloadapache2-7bb2bf1e65fd37bc9b06a18a1132ed4ac6798b11.tar.xz
apache2-7bb2bf1e65fd37bc9b06a18a1132ed4ac6798b11.zip
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
Diffstat (limited to 'modules/cache')
-rw-r--r--modules/cache/mod_cache.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/cache/mod_cache.c b/modules/cache/mod_cache.c
index 5cf04b966f..fad3df273c 100644
--- a/modules/cache/mod_cache.c
+++ b/modules/cache/mod_cache.c
@@ -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