Permalink
Browse files

fixed an issue in more_clear_headers: we should remove all the instan…

…ces of the headers specified, not only the first occurrence. thanks 李杨.
  • Loading branch information...
1 parent b1c4273 commit 2c629dee0e1e7788980d5a8fd68147ad704e57d5 @agentzh agentzh committed Jun 15, 2011
Showing with 31 additions and 6 deletions.
  1. +0 −4 src/ngx_http_headers_more_headers_out.c
  2. +21 −1 t/sanity.t
  3. +1 −1 t/subrequest.t
  4. +9 −0 valgrind.suppress
View
4 src/ngx_http_headers_more_headers_out.c
@@ -209,10 +209,6 @@ ngx_http_set_header_helper(ngx_http_request_t *r, ngx_http_headers_more_header_v
*output_header = &h[i];
}
- if (!hv->wildcard){
- return NGX_OK;
- }
-
matched = 1;
}
}
View
22 t/sanity.t
@@ -5,7 +5,7 @@ use Test::Nginx::Socket;
repeat_each(2);
-plan tests => repeat_each() * 107;
+plan tests => repeat_each() * 110;
#master_on();
#workers(2);
@@ -530,3 +530,23 @@ X-status2: nope
--- response_body
hi
+
+
+=== TEST 32: clear duplicate headers
+--- config
+ location = /backend {
+ add_header pragma no-cache;
+ add_header pragma no-cache;
+ echo hi;
+ }
+ location /hello {
+ more_clear_headers 'pragma';
+ proxy_pass http://127.0.0.1:$server_port/backend;
+ }
+--- request
+ GET /hello
+--- response_headers
+!pragma
+--- response_body
+hi
+
View
2 t/subrequest.t
@@ -1,4 +1,4 @@
-# vi:filetype=perl
+# vi:filetype=
use lib 'lib';
use Test::Nginx::Socket; # 'no_plan';
View
9 valgrind.suppress
@@ -69,4 +69,13 @@
fun:ngx_single_process_cycle
fun:main
}
+{
+ <insert_a_suppression_name_here>
+ Memcheck:Leak
+ fun:memalign
+ fun:posix_memalign
+ fun:ngx_memalign
+ fun:ngx_palloc_block
+ fun:ngx_palloc
+}

0 comments on commit 2c629de

Please sign in to comment.