Commit a253facd authored by Rainer Jung's avatar Rainer Jung
Browse files

mod_cache: Handle case of an invalid Expires

header value RFC compliant like the case of an
Expires time in the past: allow to overwrite the
non-caching decision using CacheStoreExpired and
respect Cache-Control "max-age" and "s-maxage".

Backport of r1833876 from trunk.

Submitted by: rjung
Reviewed by: rjung, ylavic, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1834241 13f79535-47bb-0310-9956-ffa450edef68
parent e66e1a61
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
                                                         -*- coding: utf-8 -*-
Changes with Apache 2.4.34

  *) mod_cache: Handle case of an invalid Expires header value RFC compliant
     like the case of an Expires time in the past: allow to overwrite the
     non-caching decision using CacheStoreExpired and respect Cache-Control
     "max-age" and "s-maxage".  [Rainer Jung]

  *) mod_xml2enc: Fix forwarding of error metadata/responses. PR 62180.
     [Micha Lenk <micha lenk.info>, Yann Ylavic]

+0 −10
Original line number Diff line number Diff line
@@ -148,16 +148,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
                  svn merge -c 1833827 ^/httpd/httpd/trunk . 
     +1: covener, jim, rjung

  *) mod_cache: Handle case of invalid Expires header RFC compliant
                like the case of an Expires time in the past.
                So allow to overwrite the non-caching decision
                using "CacheStoreExpired" and respect Cache-Control
                "max-age" and "s-maxage".
     trunk patch: http://svn.apache.org/r1833876
     2.4.x patch: trunk works (needs CHANGES in 2.4)
                  svn merge -c 1833876 ^/httpd/httpd/trunk . 
     +1: rjung, ylavic, rpluem


PATCHES PROPOSED TO BACKPORT FROM TRUNK:
  [ New proposals should be added at the end of the list ]
+5 −2
Original line number Diff line number Diff line
@@ -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