comparison h2_headers.t @ 1714:e4e711d07e6c

Tests: added URI tests with forbidden control characters.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 29 Jun 2021 11:58:21 +0300
parents 5ac6efbe5552
children 3604ef83c1aa
comparison
equal deleted inserted replaced
1713:77a9e393ed46 1714:e4e711d07e6c
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 rewrite/)->plan(104) 26 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy rewrite/)->plan(105)
27 ->write_file_expand('nginx.conf', <<'EOF'); 27 ->write_file_expand('nginx.conf', <<'EOF');
28 28
29 %%TEST_GLOBALS%% 29 %%TEST_GLOBALS%%
30 30
31 daemon off; 31 daemon off;
1056 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]); 1056 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
1057 1057
1058 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; 1058 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
1059 is($frame->{headers}->{':status'}, 400, 'invalid path'); 1059 is($frame->{headers}->{':status'}, 400, 'invalid path');
1060 1060
1061 TODO: {
1062 local $TODO = 'not yet' unless $t->has_version('1.21.1');
1063
1064 $sid = $s->new_stream({ path => "/t1.html\x02" });
1065 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
1066
1067 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
1068 is($frame->{headers}->{':status'}, 400, 'invalid path control');
1069
1070 }
1061 1071
1062 # ngx_http_v2_parse_int() error handling 1072 # ngx_http_v2_parse_int() error handling
1063 1073
1064 # NGX_ERROR 1074 # NGX_ERROR
1065 1075