changeset 1768:fb88778d4580

Tests: perl $r->header_in() combining headers test.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 30 May 2022 21:33:44 +0300
parents d7e019157cd7
children 735226e4c7fe
files perl.t
diffstat 1 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/perl.t
+++ b/perl.t
@@ -23,7 +23,7 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http perl rewrite/)->plan(25)
+my $t = Test::Nginx->new()->has(qw/http perl rewrite/)->plan(27)
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
@@ -153,6 +153,18 @@ like(http(
 	. 'Host: localhost' . CRLF . CRLF
 ), qr/xfoo: foo/, 'perl header_in unknown');
 
+TODO: {
+local $TODO = 'not yet' unless $t->has_version('1.23.0');
+
+like(http(
+	'GET / HTTP/1.0' . CRLF
+	. 'X-Foo: foo' . CRLF
+	. 'X-Foo: bar' . CRLF
+	. 'Host: localhost' . CRLF . CRLF
+), qr/xfoo: foo, bar/, 'perl header_in unknown2');
+
+}
+
 like(http(
 	'GET / HTTP/1.0' . CRLF
 	. 'Cookie: foo' . CRLF
@@ -188,6 +200,13 @@ like(http(
 	. 'Host: localhost' . CRLF . CRLF
 ), qr/connection: close/, 'perl header_in connection');
 
+like(http(
+	'GET / HTTP/1.0' . CRLF
+	. 'Connection: close' . CRLF
+	. 'Connection: foo' . CRLF
+	. 'Host: localhost' . CRLF . CRLF
+), qr/connection: close, foo/, 'perl header_in connection2');
+
 }
 
 # headers_out content-length tests with range filter