comparison h2_request_body.t @ 1693:5ac6efbe5552

Tests: removed TODO and try_run() checks for legacy versions.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 01 Jun 2021 16:40:18 +0300
parents 36d69685605e
children 6842b0f7fb9e
comparison
equal deleted inserted replaced
1692:f6795e2e6a4b 1693:5ac6efbe5552
166 'request without body - content length'); 166 'request without body - content length');
167 167
168 # request body discarded 168 # request body discarded
169 # RST_STREAM with zero code received 169 # RST_STREAM with zero code received
170 170
171 TODO: {
172 local $TODO = 'not yet' unless $t->has_version('1.17.4');
173
174 $s = Test::Nginx::HTTP2->new(); 171 $s = Test::Nginx::HTTP2->new();
175 $sid = $s->new_stream({ body_more => 1 }); 172 $sid = $s->new_stream({ body_more => 1 });
176 $frames = $s->read(all => [{ type => 'RST_STREAM' }], wait => 0.5); 173 $frames = $s->read(all => [{ type => 'RST_STREAM' }], wait => 0.5);
177 174
178 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; 175 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames;
179 is($frame->{code}, 0, 'request body discarded - zero RST_STREAM'); 176 is($frame->{code}, 0, 'request body discarded - zero RST_STREAM');
180
181 }
182 177
183 # malformed request body length not equal to content-length 178 # malformed request body length not equal to content-length
184 179
185 $s = Test::Nginx::HTTP2->new(); 180 $s = Test::Nginx::HTTP2->new();
186 $sid = $s->new_stream({ body_more => 1, headers => [ 181 $sid = $s->new_stream({ body_more => 1, headers => [
463 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; 458 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
464 isnt($frame->{headers}->{'x-body'}, 'xxxx', 'sync buffer'); 459 isnt($frame->{headers}->{'x-body'}, 'xxxx', 'sync buffer');
465 460
466 # request body after 400 errors redirected to a proxied location 461 # request body after 400 errors redirected to a proxied location
467 462
468 TODO: {
469 todo_skip 'leaves coredump', 1 unless $ENV{TEST_NGINX_UNSAFE}
470 or $t->has_version('1.19.3');
471
472 $s = Test::Nginx::HTTP2->new(); 463 $s = Test::Nginx::HTTP2->new();
473 $sid = $s->new_stream({ body => "", headers => [ 464 $sid = $s->new_stream({ body => "", headers => [
474 { name => ':method', value => "" }]}); 465 { name => ':method', value => "" }]});
475 466
476 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]); 467 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
477 ($frame) = grep { $_->{type} eq 'DATA' } @$frames; 468 ($frame) = grep { $_->{type} eq 'DATA' } @$frames;
478 is($frame->{data}, 'SEE-THIS', 'request body after 400 redirect'); 469 is($frame->{data}, 'SEE-THIS', 'request body after 400 redirect');
479
480 }
481 470
482 ############################################################################### 471 ###############################################################################
483 472
484 sub read_body_file { 473 sub read_body_file {
485 my ($path) = @_; 474 my ($path) = @_;