[PATCH 07 of 10] Tests: perl $r->header_in() combining headers test

Maxim Dounin mdounin at mdounin.ru
Wed Apr 20 22:37:48 UTC 2022


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1650492936 -10800
#      Thu Apr 21 01:15:36 2022 +0300
# Node ID 97a72607140290452a991ce98f3eb1d004b6eabc
# Parent  01665f0b84e6cb185ec289955b0058a22459566c
Tests: perl $r->header_in() combining headers test.

diff --git a/perl.t b/perl.t
--- 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';
+
+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



More information about the nginx-devel mailing list