# HG changeset patch # User Sergey Kandaurov # Date 1441209804 -10800 # Node ID 9d6c865c2869bbdccb82ed1561cc50da6db6f261 # Parent 66f94d6c5047c8e563acb3c449ac3cdf4feb98ad Tests: HTTP/2 regression test for empty authority request header. diff --git a/h2.t b/h2.t --- a/h2.t +++ b/h2.t @@ -32,7 +32,7 @@ plan(skip_all => 'IO::Socket::SSL too ol my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/) ->has(qw/limit_conn rewrite realip shmem/) - ->has_daemon('openssl')->plan(161); + ->has_daemon('openssl')->plan(162); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -1495,6 +1495,19 @@ is($frame->{headers}->{':status'}, 400, } +# empty request header ':authority' + +$sess = new_session(); +$sid = new_stream($sess, { headers => [ + { name => ':method', value => 'GET', mode => 0 }, + { name => ':scheme', value => 'http', mode => 0 }, + { name => ':path', value => '/', mode => 0 }, + { name => ':authority', value => '', mode => 0 }]}); +$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); + +($frame) = grep { $_->{type} eq "HEADERS" } @$frames; +is($frame->{headers}->{':status'}, 400, 'empty authority'); + # GOAWAY - force closing a connection by server $sid = new_stream($sess, { path => 't1.html' });