changeset 717:3b6ff3b7367d

Tests: fixed multiple header field values representation in h2.t.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 28 Sep 2015 16:41:02 +0300
parents e3fd2c8d257e
children ba822b2e899c
files h2.t proxy.t realip.t
diffstat 3 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/h2.t
+++ b/h2.t
@@ -2597,7 +2597,7 @@ sub hunpack {
 	sub add {
 		my ($h, $n, $v) = @_;
 		return $h->{$n} = $v unless exists $h->{$n};
-		$h->{$n} = [ $h->{$n} ];
+		$h->{$n} = [ $h->{$n} ] unless ref $h->{$n};
 		push @{$h->{$n}}, $v;
 	}
 
--- a/proxy.t
+++ b/proxy.t
@@ -38,7 +38,7 @@ http {
     server {
         listen       127.0.0.1:8080;
         server_name  localhost;
-
+add_header X-Port $remote_port;
         location / {
             proxy_pass http://127.0.0.1:8081;
             proxy_read_timeout 1s;
--- a/realip.t
+++ b/realip.t
@@ -36,6 +36,7 @@ http {
     %%TEST_GLOBALS_HTTP%%
 
     add_header X-IP $remote_addr;
+    add_header X-Port $remote_port;
     set_real_ip_from  127.0.0.1/32;
     set_real_ip_from  10.0.1.0/24;