Mercurial > hg > nginx-tests
changeset 673:9d6c865c2869
Tests: HTTP/2 regression test for empty authority request header.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 02 Sep 2015 19:03:24 +0300 |
parents | 66f94d6c5047 |
children | 2d10f958741d |
files | h2.t |
diffstat | 1 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/h2.t Wed Sep 02 17:37:48 2015 +0300 +++ b/h2.t Wed Sep 02 19:03:24 2015 +0300 @@ -32,7 +32,7 @@ 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 @@ } +# 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' });