comparison src/http/ngx_http_upstream.c @ 4769:f88555d76886

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
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 30 Jul 2012 10:35:26 +0000
parents 284cb8fb0741
children 508e61393b6c
comparison
equal deleted inserted replaced
4768:1c5e2e4d5b35 4769:f88555d76886
4539 ngx_hash_key_t *hk; 4539 ngx_hash_key_t *hk;
4540 4540
4541 if (conf->hide_headers == NGX_CONF_UNSET_PTR 4541 if (conf->hide_headers == NGX_CONF_UNSET_PTR
4542 && conf->pass_headers == NGX_CONF_UNSET_PTR) 4542 && conf->pass_headers == NGX_CONF_UNSET_PTR)
4543 { 4543 {
4544 conf->hide_headers = prev->hide_headers;
4545 conf->pass_headers = prev->pass_headers;
4546
4544 conf->hide_headers_hash = prev->hide_headers_hash; 4547 conf->hide_headers_hash = prev->hide_headers_hash;
4545 4548
4546 if (conf->hide_headers_hash.buckets 4549 if (conf->hide_headers_hash.buckets
4547 #if (NGX_HTTP_CACHE) 4550 #if (NGX_HTTP_CACHE)
4548 && ((conf->cache == NULL) == (prev->cache == NULL)) 4551 && ((conf->cache == NULL) == (prev->cache == NULL))
4550 ) 4553 )
4551 { 4554 {
4552 return NGX_OK; 4555 return NGX_OK;
4553 } 4556 }
4554 4557
4555 conf->hide_headers = prev->hide_headers;
4556 conf->pass_headers = prev->pass_headers;
4557
4558 } else { 4558 } else {
4559 if (conf->hide_headers == NGX_CONF_UNSET_PTR) { 4559 if (conf->hide_headers == NGX_CONF_UNSET_PTR) {
4560 conf->hide_headers = prev->hide_headers; 4560 conf->hide_headers = prev->hide_headers;
4561 } 4561 }
4562 4562