Mercurial > hg > nginx-tests
changeset 729:41caaaff9b95
Tests: added HTTP/2 tests for invalid table size update.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 01 Oct 2015 19:24:00 +0300 |
parents | 61800918f647 |
children | 63c45a158cde |
files | h2.t |
diffstat | 1 files changed, 17 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/h2.t Thu Oct 01 17:43:54 2015 +0300 +++ b/h2.t Thu Oct 01 19:24:00 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(216); + ->has_daemon('openssl')->plan(219); # FreeBSD has a bug in not treating zero iovcnt as EINVAL @@ -603,6 +603,22 @@ is($frame->{last_sid}, $sid, 'invalid index - GOAWAY last stream'); is($frame->{code}, 9, 'invalid index - GOAWAY COMPRESSION_ERROR'); +# invalid table size update + +$sess = new_session(); +$sid = new_stream($sess, { table_size => 4097, headers => [ + { name => ':method', value => 'GET', mode => 0 }, + { name => ':scheme', value => 'http', mode => 0 }, + { name => ':path', value => '/', mode => 0 }, + { name => 'x-foo', value => 'X-Bar', mode => 0 }, + { name => ':authority', value => 'localhost', mode => 1 }]}); +$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); + +($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; +ok($frame, 'invalid table size - GOAWAY'); +is($frame->{last_sid}, $sid, 'invalid table size - GOAWAY last stream'); +is($frame->{code}, 9, 'invalid table size - GOAWAY COMPRESSION_ERROR'); + # HEAD $sess = new_session();