Skip to content

Commit cc66734

Browse files
committed
Tests: perl $r->header_in() combining headers test.
1 parent d3b167c commit cc66734

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

perl.t

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use Test::Nginx;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
my $t = Test::Nginx->new()->has(qw/http perl rewrite/)->plan(25)
26+
my $t = Test::Nginx->new()->has(qw/http perl rewrite/)->plan(27)
2727
->write_file_expand('nginx.conf', <<'EOF');
2828
2929
%%TEST_GLOBALS%%
@@ -153,6 +153,18 @@ like(http(
153153
. 'Host: localhost' . CRLF . CRLF
154154
), qr/xfoo: foo/, 'perl header_in unknown');
155155

156+
TODO: {
157+
local $TODO = 'not yet' unless $t->has_version('1.23.0');
158+
159+
like(http(
160+
'GET / HTTP/1.0' . CRLF
161+
. 'X-Foo: foo' . CRLF
162+
. 'X-Foo: bar' . CRLF
163+
. 'Host: localhost' . CRLF . CRLF
164+
), qr/xfoo: foo, bar/, 'perl header_in unknown2');
165+
166+
}
167+
156168
like(http(
157169
'GET / HTTP/1.0' . CRLF
158170
. 'Cookie: foo' . CRLF
@@ -188,6 +200,13 @@ like(http(
188200
. 'Host: localhost' . CRLF . CRLF
189201
), qr/connection: close/, 'perl header_in connection');
190202

203+
like(http(
204+
'GET / HTTP/1.0' . CRLF
205+
. 'Connection: close' . CRLF
206+
. 'Connection: foo' . CRLF
207+
. 'Host: localhost' . CRLF . CRLF
208+
), qr/connection: close, foo/, 'perl header_in connection2');
209+
191210
}
192211

193212
# headers_out content-length tests with range filter

0 commit comments

Comments
 (0)