From ff7722bc9ac179985c79d302e0ac9aa98c2570c9 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Fri, 9 Dec 2016 14:00:51 +0000 Subject: [PATCH] ProxyPass ! doesn't block per-directory ProxyPass *) mod_proxy: Honor a server scoped ProxyPass exception when ProxyPass is configured in , like in 2.2. PR 60458. [Eric Covener] reverted in r1781324 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773397 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 +++++- modules/proxy/mod_proxy.c | 19 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index f50ca64170..e8110fe849 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,13 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_proxy: Honor a server scoped ProxyPass exception when ProxyPass is + configured in , like in 2.2. PR 60458. + [Eric Covener] + *) core: Drop Content-Length header and message-body from HTTP 204 responses. PR 51350 [Luca Toscano] - + *) mod_lua: Fix default value of LuaInherit directive. It should be 'parent-first' instead of 'none', as per documentation. PR 60419 [Christophe Jaillet] diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index ceb2c39739..5eb74acde9 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -788,18 +788,29 @@ static int proxy_trans(request_rec *r) */ dconf = ap_get_module_config(r->per_dir_config, &proxy_module); - + conf = (proxy_server_conf *) ap_get_module_config(r->server->module_config, + &proxy_module); /* short way - this location is reverse proxied? */ if (dconf->alias) { int rv = ap_proxy_trans_match(r, dconf->alias, dconf); + if (OK == rv) { + /* Got a hit. Need to make sure it's not explicitly declined */ + if (conf->aliases->nelts) { + ent = (struct proxy_alias *) conf->aliases->elts; + for (i = 0; i < conf->aliases->nelts; i++) { + int rv = ap_proxy_trans_match(r, &ent[i], dconf); + if (DECLINED == rv) { + return DECLINED; + } + } + } + return OK; + } if (DONE != rv) { return rv; } } - conf = (proxy_server_conf *) ap_get_module_config(r->server->module_config, - &proxy_module); - /* long way - walk the list of aliases, find a match */ if (conf->aliases->nelts) { ent = (struct proxy_alias *) conf->aliases->elts;