mirror of
https://github.com/nginx/nginx.git
synced 2025-06-09 02:42:48 +08:00
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
This commit is contained in:
parent
1c31039d1e
commit
21be49ae59
@ -4541,6 +4541,9 @@ ngx_http_upstream_hide_headers_hash(ngx_conf_t *cf,
|
|||||||
if (conf->hide_headers == NGX_CONF_UNSET_PTR
|
if (conf->hide_headers == NGX_CONF_UNSET_PTR
|
||||||
&& conf->pass_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;
|
conf->hide_headers_hash = prev->hide_headers_hash;
|
||||||
|
|
||||||
if (conf->hide_headers_hash.buckets
|
if (conf->hide_headers_hash.buckets
|
||||||
@ -4552,9 +4555,6 @@ ngx_http_upstream_hide_headers_hash(ngx_conf_t *cf,
|
|||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
conf->hide_headers = prev->hide_headers;
|
|
||||||
conf->pass_headers = prev->pass_headers;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (conf->hide_headers == NGX_CONF_UNSET_PTR) {
|
if (conf->hide_headers == NGX_CONF_UNSET_PTR) {
|
||||||
conf->hide_headers = prev->hide_headers;
|
conf->hide_headers = prev->hide_headers;
|
||||||
|
Loading…
Reference in New Issue
Block a user