comparison h2_headers.t @ 1273:9b737ad4260b

Tests: expect HTTP 400 on HTTP/2 pseudo-header parsing error.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 30 Jan 2018 15:15:33 +0300
parents 366d789f3cbf
children 97c8280de681
comparison
equal deleted inserted replaced
1272:01010d9021b8 1273:9b737ad4260b
986 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; 986 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
987 is($frame->{headers}->{':status'}, 400, 'empty authority'); 987 is($frame->{headers}->{':status'}, 400, 'empty authority');
988 988
989 # client sent invalid :path header 989 # client sent invalid :path header
990 990
991 TODO: {
992 local $TODO = 'not yet' unless $t->has_version('1.13.9');
993
991 $sid = $s->new_stream({ path => 't1.html' }); 994 $sid = $s->new_stream({ path => 't1.html' });
992 $frames = $s->read(all => [{ type => 'RST_STREAM' }]); 995 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
993 996
994 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames; 997 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
995 is($frame->{code}, 1, 'invalid path'); 998 is($frame->{headers}->{':status'}, 400, 'invalid path');
999
1000 }
996 1001
997 ############################################################################### 1002 ###############################################################################
998 1003
999 sub http_daemon { 1004 sub http_daemon {
1000 my $server = IO::Socket::INET->new( 1005 my $server = IO::Socket::INET->new(