[PATCH 06 of 10] Tests: perl $r->header_in("Connection") test

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


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1650492934 -10800
#      Thu Apr 21 01:15:34 2022 +0300
# Node ID 01665f0b84e6cb185ec289955b0058a22459566c
# Parent  bde65a069a0d7ea1d7c456a9b9ed02daf9cb99fb
Tests: perl $r->header_in("Connection") 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(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 @@ http {
                 $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 @@ like(http(
 	. 'Host: localhost' . CRLF . CRLF
 ), qr/xff: foo1, foo2/, 'perl header_in xff2');
 
+TODO: {
+local $TODO = 'not yet';
+
+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,



More information about the nginx-devel mailing list