# HG changeset patch # User Sergey Kandaurov # Date 1624957241 -10800 # Node ID c48b2b0b8c2a5f769fd8438f5376848c98c09e57 # Parent 3604ef83c1aa99fcde653332887c3d34de86f689 Tests: added Host header test with control character. diff --git a/http_host.t b/http_host.t --- a/http_host.t +++ b/http_host.t @@ -22,7 +22,7 @@ use Test::Nginx qw/ :DEFAULT http_conten select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(36); +my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(37); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -171,6 +171,13 @@ is(http_host_header('123.40.56.78:9000:8 like(http_host_header("localhost\nHost: again", 1), qr/ 400 /, 'host repeat'); +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.21.1'); + +like(http_host_header("localhost\x02", 1), qr/ 400 /, 'control'); + +} + ############################################################################### sub http_host_header {