changeset 1283:16f091962811

Tests: added h2_server_push.t test for missing ':authority'.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 13 Feb 2018 13:36:37 +0300
parents fd281e3a3df5
children 52873012ab26
files h2_server_push.t
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h2_server_push.t
+++ b/h2_server_push.t
@@ -128,7 +128,7 @@ EOF
 $t->write_file('t2', 'SEE-THIS');
 $t->write_file('explf', join('', map { sprintf "X%06dXXX", $_ } (1 .. 6553)));
 
-$t->try_run('no http2_push')->plan(37);
+$t->try_run('no http2_push')->plan(38);
 
 ###############################################################################
 
@@ -367,4 +367,16 @@ is(grep({ $_->{type} eq "PUSH_PROMISE" }
 push @$frames, @{ $s->read(all => [{ sid => 4, fin => 1 }], wait => 0.2) };
 is(grep({ $_->{type} eq "PUSH_PROMISE" } @$frames), 1, 'http2 max pushes 2');
 
+# missing request header ':authority'
+
+$s = Test::Nginx::HTTP2->new(port(8082));
+$sid = $s->new_stream({ headers => [
+	{ name => ':method', value => 'GET', mode => 0 },
+	{ name => ':scheme', value => 'http', mode => 0 },
+	{ name => ':path', value => '/', mode => 0 }]});
+$frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
+
+($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
+is($frame->{headers}->{':status'}, 400, 'incomplete headers');
+
 ###############################################################################