changeset 1548:b02d0fd71638

Tests: added HTTP/2 test for HEADERS split on field boundary.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 05 Feb 2020 18:02:04 +0300
parents 2d747d967fc0
children 6c9e3e20af97
files h2.t
diffstat 1 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h2.t
+++ b/h2.t
@@ -26,7 +26,7 @@ select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy rewrite charset gzip/)
-	->plan(147);
+	->plan(150);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
@@ -656,6 +656,28 @@ is($frame->{code}, 1, 'client header tim
 ($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames;
 ok($frame, 'client header timeout - PING');
 
+# partial request header frame received (no field split),
+# the rest of frame is received after client header timeout
+
+$s = Test::Nginx::HTTP2->new(port(8087));
+$sid = $s->new_stream({ path => '/t2.html', split => [20], split_delay => 2.1 });
+$frames = $s->read(all => [{ type => 'RST_STREAM' }]);
+
+TODO: {
+local $TODO = 'not yet' unless $t->has_version('1.17.9');
+
+($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames;
+ok($frame, 'client header timeout 2');
+is($frame->{code}, 1, 'client header timeout 2 - protocol error');
+
+}
+
+$s->h2_ping('SEE-THIS');
+$frames = $s->read(all => [{ type => 'PING' }]);
+
+($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames;
+ok($frame, 'client header timeout 2 - PING');
+
 # partial request body data frame received, the rest is after body timeout
 
 $s = Test::Nginx::HTTP2->new(port(8087));