# HG changeset patch # User Sergey Kandaurov # Date 1518518197 -10800 # Node ID 16f091962811af62611d5e2ff525878eb4ab8f21 # Parent fd281e3a3df5989418d777549723282e73c68f9a Tests: added h2_server_push.t test for missing ':authority'. diff --git a/h2_server_push.t b/h2_server_push.t --- 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'); + ###############################################################################