Mercurial > hg > nginx-tests
changeset 1767:d7e019157cd7
Tests: perl $r->header_in("Connection") test.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 30 May 2022 21:33:05 +0300 |
parents | a2572de6e840 |
children | fb88778d4580 |
files | perl.t |
diffstat | 1 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/perl.t Mon May 30 21:32:08 2022 +0300 +++ b/perl.t Mon May 30 21:33:05 2022 +0300 @@ -23,7 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http perl rewrite/)->plan(24) +my $t = Test::Nginx->new()->has(qw/http perl rewrite/)->plan(25) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -62,6 +62,7 @@ $r->print("xfoo: ", $r->header_in("X-Foo"), "\n"); $r->print("cookie: ", $r->header_in("Cookie"), "\n"); $r->print("xff: ", $r->header_in("X-Forwarded-For"), "\n"); + $r->print("connection: ", $r->header_in("Connection"), "\n"); return OK; }'; @@ -178,6 +179,17 @@ . 'Host: localhost' . CRLF . CRLF ), qr/xff: foo1, foo2/, 'perl header_in xff2'); +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.23.0'); + +like(http( + 'GET / HTTP/1.0' . CRLF + . 'Connection: close' . CRLF + . 'Host: localhost' . CRLF . CRLF +), qr/connection: close/, 'perl header_in connection'); + +} + # headers_out content-length tests with range filter like(http_get('/range'), qr/Content-Length: 42.*^x{42}$/ms,