Tests: added URI tests with forbidden control characters.
diff --git a/h2_headers.t b/h2_headers.t
index 3f5f79f..a3c82b4 100644
--- a/h2_headers.t
+++ b/h2_headers.t
@@ -23,7 +23,7 @@
select STDERR; $| = 1;
select STDOUT; $| = 1;
-my $t = Test::Nginx->new()->has(qw/http http_v2 proxy rewrite/)->plan(104)
+my $t = Test::Nginx->new()->has(qw/http http_v2 proxy rewrite/)->plan(105)
->write_file_expand('nginx.conf', <<'EOF');
%%TEST_GLOBALS%%
@@ -1058,6 +1058,16 @@
($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
is($frame->{headers}->{':status'}, 400, 'invalid path');
+TODO: {
+local $TODO = 'not yet' unless $t->has_version('1.21.1');
+
+$sid = $s->new_stream({ path => "/t1.html\x02" });
+$frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
+
+($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
+is($frame->{headers}->{':status'}, 400, 'invalid path control');
+
+}
# ngx_http_v2_parse_int() error handling
diff --git a/http_uri.t b/http_uri.t
index 688e4ff..5cf7f63 100644
--- a/http_uri.t
+++ b/http_uri.t
@@ -22,7 +22,7 @@
select STDERR; $| = 1;
select STDOUT; $| = 1;
-my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(17)
+my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(19)
->write_file_expand('nginx.conf', <<'EOF')->run();
%%TEST_GLOBALS%%
@@ -83,4 +83,13 @@
}
+TODO: {
+local $TODO = 'not yet' unless $t->has_version('1.21.1');
+
+like(http_get("/\x02"), qr/400 Bad/, 'control');
+
+}
+
+like(http_get('/%02'), qr!x /\x02 x!, 'control escaped');
+
###############################################################################