comparison h2_request_body.t @ 888:4ab795ab2e62

Tests: added HTTP/2 test for zero RST_STREAM if discarding body.
author Andrey Zelenkov <zelenkov@nginx.com>
date Fri, 01 Apr 2016 13:16:50 +0300
parents af2cd0ba6ca7
children 266e3b2e88f9
comparison
equal deleted inserted replaced
887:5debefd670bc 888:4ab795ab2e62
21 ############################################################################### 21 ###############################################################################
22 22
23 select STDERR; $| = 1; 23 select STDERR; $| = 1;
24 select STDOUT; $| = 1; 24 select STDOUT; $| = 1;
25 25
26 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy/)->plan(34); 26 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy/)->plan(35);
27 27
28 $t->todo_alerts(); 28 $t->todo_alerts();
29 29
30 $t->write_file_expand('nginx.conf', <<'EOF'); 30 $t->write_file_expand('nginx.conf', <<'EOF');
31 31
145 is(read_body_file($frame->{headers}{'x-body-file'}), '', 145 is(read_body_file($frame->{headers}{'x-body-file'}), '',
146 'request body - empty content'); 146 'request body - empty content');
147 147
148 } 148 }
149 149
150 # request body discarded
151 # RST_STREAM with zero code received
152
153 TODO: {
154 local $TODO = 'not yet';
155
156 $sess = new_session();
157 $sid = new_stream($sess, { body_more => 1 });
158 $frames = h2_read($sess, all => [{ type => 'RST_STREAM' }]);
159
160 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames;
161 is($frame->{code}, 0, 'request body discarded - zero RST_STREAM');
162
163 }
164
150 # malformed request body length not equal to content-length 165 # malformed request body length not equal to content-length
151 166
152 $sess = new_session(); 167 $sess = new_session();
153 $sid = new_stream($sess, 168 $sid = new_stream($sess,
154 { body_more => 1, headers => [ 169 { body_more => 1, headers => [