Mercurial > hg > nginx-tests
comparison http_host.t @ 1551:27237569776f
Tests: additional Transfer-Encoding and Host headers tests.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 27 Feb 2020 19:49:54 +0300 |
parents | 9d579fc770a6 |
children | 8659123d2d37 |
comparison
equal
deleted
inserted
replaced
1550:5c96745988c4 | 1551:27237569776f |
---|---|
20 ############################################################################### | 20 ############################################################################### |
21 | 21 |
22 select STDERR; $| = 1; | 22 select STDERR; $| = 1; |
23 select STDOUT; $| = 1; | 23 select STDOUT; $| = 1; |
24 | 24 |
25 my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(35); | 25 my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(36); |
26 | 26 |
27 $t->write_file_expand('nginx.conf', <<'EOF'); | 27 $t->write_file_expand('nginx.conf', <<'EOF'); |
28 | 28 |
29 %%TEST_GLOBALS%% | 29 %%TEST_GLOBALS%% |
30 | 30 |
167 'IPvFuture all symbols (absolute request)'); | 167 'IPvFuture all symbols (absolute request)'); |
168 | 168 |
169 is(http_host_header('123.40.56.78:9000:80'), '123.40.56.78', | 169 is(http_host_header('123.40.56.78:9000:80'), '123.40.56.78', |
170 'double port hack'); | 170 'double port hack'); |
171 | 171 |
172 TODO: { | |
173 local $TODO = 'not yet' unless $t->has_version('1.17.9'); | |
174 | |
175 like(http_host_header("localhost\nHost: again", 1), qr/ 400 /, 'host repeat'); | |
176 | |
177 } | |
178 | |
172 ############################################################################### | 179 ############################################################################### |
173 | 180 |
174 sub http_host_header { | 181 sub http_host_header { |
175 my ($host, $all) = @_; | 182 my ($host, $all) = @_; |
176 my ($r) = http(<<EOF); | 183 my ($r) = http(<<EOF); |