From: Christophe Jaillet Date: Wed, 1 Aug 2018 18:53:53 +0000 (+0000) Subject: If ProxyPassReverse is used for reverse mapping of relative redirects, subsequent... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43fe7164f6a577fb8b15c2caaaa1bb38443e1ab3;p=apache If ProxyPassReverse is used for reverse mapping of relative redirects, subsequent ProxyPassReverse statements, whether they are relative or absolute, may fail. PR 60408 [Peter Haworth ] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837250 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index c1fb11d58c..1e26ed7786 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.1 + *) mod_proxy: If ProxyPassReverse is used for reverse mapping of relative + redirects, subsequent ProxyPassReverse statements, whether they are + relative or absolute, may fail. PR 60408. [Peter Haworth ] + *) mod_ratelimit: Don't interfere with "chunked" encoding, fixing regression introduced in 2.4.34. PR 62568. [Yann Ylavic] diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 5aac76f65c..24468f97bd 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -830,7 +830,7 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, { proxy_req_conf *rconf; struct proxy_alias *ent; - int i, l1, l2; + int i, l1, l1_orig, l2; char *u; /* @@ -842,7 +842,7 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, return url; } - l1 = strlen(url); + l1_orig = strlen(url); if (conf->interpolate_env == 1) { rconf = ap_get_module_config(r->request_config, &proxy_module); ent = (struct proxy_alias *)rconf->raliases->elts; @@ -855,6 +855,10 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, ap_get_module_config(r->server->module_config, &proxy_module); proxy_balancer *balancer; const char *real = ent[i].real; + + /* Restore the url length, if it had been changed by the code below */ + l1 = l1_orig; + /* * First check if mapping against a balancer and see * if we have such a entity. If so, then we need to