comparison perl.t @ 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
comparison
equal deleted inserted replaced
1767:d7e019157cd7 1768:fb88778d4580
21 ############################################################################### 21 ###############################################################################
22 22
23 select STDERR; $| = 1; 23 select STDERR; $| = 1;
24 select STDOUT; $| = 1; 24 select STDOUT; $| = 1;
25 25
26 my $t = Test::Nginx->new()->has(qw/http perl rewrite/)->plan(25) 26 my $t = Test::Nginx->new()->has(qw/http perl rewrite/)->plan(27)
27 ->write_file_expand('nginx.conf', <<'EOF'); 27 ->write_file_expand('nginx.conf', <<'EOF');
28 28
29 %%TEST_GLOBALS%% 29 %%TEST_GLOBALS%%
30 30
31 daemon off; 31 daemon off;
151 'GET / HTTP/1.0' . CRLF 151 'GET / HTTP/1.0' . CRLF
152 . 'X-Foo: foo' . CRLF 152 . 'X-Foo: foo' . CRLF
153 . 'Host: localhost' . CRLF . CRLF 153 . 'Host: localhost' . CRLF . CRLF
154 ), qr/xfoo: foo/, 'perl header_in unknown'); 154 ), qr/xfoo: foo/, 'perl header_in unknown');
155 155
156 TODO: {
157 local $TODO = 'not yet' unless $t->has_version('1.23.0');
158
159 like(http(
160 'GET / HTTP/1.0' . CRLF
161 . 'X-Foo: foo' . CRLF
162 . 'X-Foo: bar' . CRLF
163 . 'Host: localhost' . CRLF . CRLF
164 ), qr/xfoo: foo, bar/, 'perl header_in unknown2');
165
166 }
167
156 like(http( 168 like(http(
157 'GET / HTTP/1.0' . CRLF 169 'GET / HTTP/1.0' . CRLF
158 . 'Cookie: foo' . CRLF 170 . 'Cookie: foo' . CRLF
159 . 'Host: localhost' . CRLF . CRLF 171 . 'Host: localhost' . CRLF . CRLF
160 ), qr/cookie: foo/, 'perl header_in cookie'); 172 ), qr/cookie: foo/, 'perl header_in cookie');
185 like(http( 197 like(http(
186 'GET / HTTP/1.0' . CRLF 198 'GET / HTTP/1.0' . CRLF
187 . 'Connection: close' . CRLF 199 . 'Connection: close' . CRLF
188 . 'Host: localhost' . CRLF . CRLF 200 . 'Host: localhost' . CRLF . CRLF
189 ), qr/connection: close/, 'perl header_in connection'); 201 ), qr/connection: close/, 'perl header_in connection');
202
203 like(http(
204 'GET / HTTP/1.0' . CRLF
205 . 'Connection: close' . CRLF
206 . 'Connection: foo' . CRLF
207 . 'Host: localhost' . CRLF . CRLF
208 ), qr/connection: close, foo/, 'perl header_in connection2');
190 209
191 } 210 }
192 211
193 # headers_out content-length tests with range filter 212 # headers_out content-length tests with range filter
194 213