[nginx-tests] Tests: added test for headers without a colon.

Maxim Dounin mdounin at mdounin.ru
Sat May 11 15:57:02 UTC 2024


details:   http://freenginx.org/hg/nginx-tests/rev/4e79bd25642f
branches:  
changeset: 1976:4e79bd25642f
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Sat May 11 18:56:23 2024 +0300
description:
Tests: added test for headers without a colon.

diffstat:

 http_request.t |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (25 lines):

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