changeset 1716:c48b2b0b8c2a

Tests: added Host header test with control character.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 29 Jun 2021 12:00:41 +0300
parents 3604ef83c1aa
children 3052d6ea8ff3
files http_host.t
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 {