comparison 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
comparison
equal deleted inserted replaced
832:04eb968b0987 833:62315953d703
30 eval { IO::Socket::SSL::SSL_VERIFY_NONE(); }; 30 eval { IO::Socket::SSL::SSL_VERIFY_NONE(); };
31 plan(skip_all => 'IO::Socket::SSL too old') if $@; 31 plan(skip_all => 'IO::Socket::SSL too old') if $@;
32 32
33 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/) 33 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/)
34 ->has(qw/limit_conn rewrite realip shmem/) 34 ->has(qw/limit_conn rewrite realip shmem/)
35 ->has_daemon('openssl')->plan(301); 35 ->has_daemon('openssl')->plan(302);
36 36
37 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL 37 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL
38 38
39 $t->todo_alerts(); 39 $t->todo_alerts();
40 40
1440 { path => '/proxy2/t2.html', body => 'TEST', body_split => [2] }); 1440 { path => '/proxy2/t2.html', body => 'TEST', body_split => [2] });
1441 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); 1441 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
1442 1442
1443 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; 1443 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
1444 is($frame->{headers}->{'x-body'}, 'TEST', 'request body in multiple frames'); 1444 is($frame->{headers}->{'x-body'}, 'TEST', 'request body in multiple frames');
1445
1446 # request body with an empty DATA frame
1447 # "zero size buf in output" alerts seen
1448
1449 $sess = new_session();
1450 $sid = new_stream($sess, { body => '', headers => [
1451 { name => ':method', value => 'GET', mode => 2 },
1452 { name => ':scheme', value => 'http', mode => 2 },
1453 { name => ':path', value => '/proxy2/', mode => 2 },
1454 { name => ':authority', value => 'localhost', mode => 2 }]});
1455 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
1456
1457 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
1458 is($frame->{headers}->{':status'}, 200, 'request body - empty');
1445 1459
1446 # request body delayed in limit_req 1460 # request body delayed in limit_req
1447 1461
1448 $sess = new_session(); 1462 $sess = new_session();
1449 $sid = new_stream($sess, { path => '/proxy_limit_req/', body => 'TEST' }); 1463 $sid = new_stream($sess, { path => '/proxy_limit_req/', body => 'TEST' });