From 393aa13887dc6c8510001cfa8b4024382d5f8ad8 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Sat, 12 Jan 2019 07:51:48 +0000 Subject: [PATCH] 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 ] + 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 --- modules/cache/cache_storage.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/cache/cache_storage.c b/modules/cache/cache_storage.c index 41f638c025..dfda34b1c1 100644 --- a/modules/cache/cache_storage.c +++ b/modules/cache/cache_storage.c @@ -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 = ""; -- 2.40.0