[PATCH] Tests: added test for headers without a colon

Maxim Dounin mdounin at mdounin.ru
Wed May 8 20:57:20 UTC 2024


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1715201571 -10800
#      Wed May 08 23:52:51 2024 +0300
# Node ID e62a5943d54efd1f0d2380f9ecc0ea76de9d3163
# Parent  2e3736daf409fdb12ac27ab123292dac4d8e4940
Tests: added test for headers without a colon.

diff --git a/http_request.t b/http_request.t
--- a/http_request.t
+++ b/http_request.t
@@ -23,7 +23,7 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(40)
+my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(41)
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
@@ -187,4 +187,12 @@ like(http("GET / HTTP/1.0" . CRLF . "Foo
 like(http("GET / HTTP/1.0" . CRLF . "Foo\t: bar" . CRLF . CRLF), qr/ 400 /,
 	'header with tab rejected');
 
+TODO: {
+local $TODO = 'not yet' unless $t->has_version('1.27.0');
+
+like(http("GET / HTTP/1.0" . CRLF . "Foo" . CRLF . CRLF), qr/ 400 /,
+	'header without colon rejected');
+
+}
+
 ###############################################################################




More information about the nginx-devel mailing list