Skip to content

Commit d3b167c

Browse files
committed
Tests: perl $r->header_in("Connection") test.
1 parent aa1b7ff commit d3b167c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

perl.t

Lines changed: 13 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(24)
26+
my $t = Test::Nginx->new()->has(qw/http perl rewrite/)->plan(25)
2727
->write_file_expand('nginx.conf', <<'EOF');
2828
2929
%%TEST_GLOBALS%%
@@ -62,6 +62,7 @@ http {
6262
$r->print("xfoo: ", $r->header_in("X-Foo"), "\n");
6363
$r->print("cookie: ", $r->header_in("Cookie"), "\n");
6464
$r->print("xff: ", $r->header_in("X-Forwarded-For"), "\n");
65+
$r->print("connection: ", $r->header_in("Connection"), "\n");
6566
6667
return OK;
6768
}';
@@ -178,6 +179,17 @@ like(http(
178179
. 'Host: localhost' . CRLF . CRLF
179180
), qr/xff: foo1, foo2/, 'perl header_in xff2');
180181

182+
TODO: {
183+
local $TODO = 'not yet' unless $t->has_version('1.23.0');
184+
185+
like(http(
186+
'GET / HTTP/1.0' . CRLF
187+
. 'Connection: close' . CRLF
188+
. 'Host: localhost' . CRLF . CRLF
189+
), qr/connection: close/, 'perl header_in connection');
190+
191+
}
192+
181193
# headers_out content-length tests with range filter
182194

183195
like(http_get('/range'), qr/Content-Length: 42.*^x{42}$/ms,

0 commit comments

Comments
 (0)