Mercurial > hg > nginx-tests
changeset 1597:36d69685605e
Tests: added HTTP/2 tests for DATA frames after 400 errors.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 01 Oct 2020 12:28:34 +0100 |
parents | f42d82b114cd |
children | f069dd7ba5a7 |
files | h2_request_body.t |
diffstat | 1 files changed, 19 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/h2_request_body.t Tue Sep 29 10:59:16 2020 +0100 +++ b/h2_request_body.t Thu Oct 01 12:28:34 2020 +0100 @@ -23,7 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http http_v2 proxy/)->plan(44); +my $t = Test::Nginx->new()->has(qw/http http_v2 proxy/)->plan(45); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -42,6 +42,8 @@ listen 127.0.0.1:8081; server_name localhost; + error_page 400 /proxy2/t.html; + location / { add_header X-Length $http_content_length; } @@ -461,6 +463,22 @@ ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; isnt($frame->{headers}->{'x-body'}, 'xxxx', 'sync buffer'); +# request body after 400 errors redirected to a proxied location + +TODO: { +todo_skip 'leaves coredump', 1 unless $ENV{TEST_NGINX_UNSAFE} + or $t->has_version('1.19.3'); + +$s = Test::Nginx::HTTP2->new(); +$sid = $s->new_stream({ body => "", headers => [ + { name => ':method', value => "" }]}); + +$frames = $s->read(all => [{ sid => $sid, fin => 1 }]); +($frame) = grep { $_->{type} eq 'DATA' } @$frames; +is($frame->{data}, 'SEE-THIS', 'request body after 400 redirect'); + +} + ############################################################################### sub read_body_file {