Mercurial > hg > nginx-tests
diff h2.t @ 833:62315953d703
Tests: HTTP/2 test with empty request body.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 28 Jan 2016 12:49:44 +0300 |
parents | 04eb968b0987 |
children | ecffe6c23a14 |
line wrap: on
line diff
--- a/h2.t Thu Jan 28 12:23:54 2016 +0300 +++ b/h2.t Thu Jan 28 12:49:44 2016 +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(301); + ->has_daemon('openssl')->plan(302); # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL @@ -1443,6 +1443,20 @@ ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; is($frame->{headers}->{'x-body'}, 'TEST', 'request body in multiple frames'); +# request body with an empty DATA frame +# "zero size buf in output" alerts seen + +$sess = new_session(); +$sid = new_stream($sess, { body => '', headers => [ + { name => ':method', value => 'GET', mode => 2 }, + { name => ':scheme', value => 'http', mode => 2 }, + { name => ':path', value => '/proxy2/', mode => 2 }, + { name => ':authority', value => 'localhost', mode => 2 }]}); +$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); + +($frame) = grep { $_->{type} eq "HEADERS" } @$frames; +is($frame->{headers}->{':status'}, 200, 'request body - empty'); + # request body delayed in limit_req $sess = new_session();