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	Tue Jun 29 12:00:07 2021 +0300
+++ b/http_host.t	Tue Jun 29 12:00:41 2021 +0300
@@ -22,7 +22,7 @@
 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 @@
 
 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 {