aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_upstream.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2012-07-30 10:35:26 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2012-07-30 10:35:26 +0000
commit21be49ae59329c0f7a2196a9a9619a3ba0498c0c (patch)
treefcce6a91e37f1a811b6b5f9384bfff95d01f2725 /src/http/ngx_http_upstream.c
parent1c31039d1e0cc8d06fe5cd2b6ad727d3c1c25853 (diff)
downloadnginx-21be49ae59329c0f7a2196a9a9619a3ba0498c0c.tar.gz
nginx-21be49ae59329c0f7a2196a9a9619a3ba0498c0c.zip
Upstream: hide_headers/pass_headers inheritance fix.
Hide headers and pass headers arrays might not be inherited correctly into a nested location, e.g. in configuration like server { proxy_hide_header X-Foo; location / { location /nested/ { proxy_pass_header X-Pad; } } } the X-Foo header wasn't hidden in the location /nested/. Reported by Konstantin Svist, http://mailman.nginx.org/pipermail/nginx-ru/2012-July/047555.html
Diffstat (limited to 'src/http/ngx_http_upstream.c')
-rw-r--r--src/http/ngx_http_upstream.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 2cbb2cb93..6c34f39d6 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -4541,6 +4541,9 @@ ngx_http_upstream_hide_headers_hash(ngx_conf_t *cf,
if (conf->hide_headers == NGX_CONF_UNSET_PTR
&& conf->pass_headers == NGX_CONF_UNSET_PTR)
{
+ conf->hide_headers = prev->hide_headers;
+ conf->pass_headers = prev->pass_headers;
+
conf->hide_headers_hash = prev->hide_headers_hash;
if (conf->hide_headers_hash.buckets
@@ -4552,9 +4555,6 @@ ngx_http_upstream_hide_headers_hash(ngx_conf_t *cf,
return NGX_OK;
}
- conf->hide_headers = prev->hide_headers;
- conf->pass_headers = prev->pass_headers;
-
} else {
if (conf->hide_headers == NGX_CONF_UNSET_PTR) {
conf->hide_headers = prev->hide_headers;