Commit 6826a7c1 authored by Christophe Jaillet's avatar Christophe Jaillet
Browse files

When a :port is included in the CacheKeyBaseURL the ":" is lost from the...

When a :port is included in the CacheKeyBaseURL the ":" is lost from the actual cache key value.  This doesn't harm apache by itself, the real problem arise if some external program which "knows" about the cache keys structure is used to modify the cache.

When CacheKeyBaseURL is not use, the ":" is kept.

So, be consistent when building the key and keep the ":" in all cases.

PR 53915 [Rein Tollevik <rein basefarm.no>]

+ merge 2 lines of a comment to have it more compact

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1851146 13f79535-47bb-0310-9956-ffa450edef68
parent 55ba58dc
Loading
Loading
Loading
Loading
+2 −3
Changes for modules/cache/cache_storage.c: 2 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -270,8 +270,7 @@ int cache_select(cache_request_rec *cache, request_rec *r)
             * language negotiated document in a different language by mistake.
             *
             * This code makes the assumption that the storage manager will
             * cache the req_hdrs if the response contains a Vary
             * header.
             * cache the req_hdrs if the response contains a Vary header.
             *
             * RFC2616 13.6 and 14.44 describe the Vary mechanism.
             */
@@ -549,7 +548,7 @@ static apr_status_t cache_canonicalise_key(request_rec *r, apr_pool_t* p,
    }
    else {
        if (conf->base_uri && conf->base_uri->port_str) {
            port_str = conf->base_uri->port_str;
            port_str = apr_pstrcat(p, ":", conf->base_uri->port_str, NULL);
        }
        else if (conf->base_uri && conf->base_uri->hostname) {
            port_str = "";