changeset 1976:4e79bd25642f

Tests: added test for headers without a colon.
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 11 May 2024 18:56:23 +0300
parents e6b20af0be5b
children 913d96252b7a
files http_request.t
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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');
+
+}
+
 ###############################################################################