# HG changeset patch # User Andrey Zelenkov # Date 1459505810 -10800 # Node ID 4ab795ab2e629407c253d8b2db58c6e32094c99e # Parent 5debefd670bcbc1d4344913bd4754452892f4cb2 Tests: added HTTP/2 test for zero RST_STREAM if discarding body. diff --git a/h2_request_body.t b/h2_request_body.t --- a/h2_request_body.t +++ b/h2_request_body.t @@ -23,7 +23,7 @@ use Test::Nginx::HTTP2 qw/ :DEFAULT :fra select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http http_v2 proxy/)->plan(34); +my $t = Test::Nginx->new()->has(qw/http http_v2 proxy/)->plan(35); $t->todo_alerts(); @@ -147,6 +147,21 @@ is(read_body_file($frame->{headers}{'x-b } +# request body discarded +# RST_STREAM with zero code received + +TODO: { +local $TODO = 'not yet'; + +$sess = new_session(); +$sid = new_stream($sess, { body_more => 1 }); +$frames = h2_read($sess, all => [{ type => 'RST_STREAM' }]); + +($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; +is($frame->{code}, 0, 'request body discarded - zero RST_STREAM'); + +} + # malformed request body length not equal to content-length $sess = new_session();