Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion h2.t
Original file line number Diff line number Diff line change
Expand Up @@ -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(143);
->plan(144);

$t->write_file_expand('nginx.conf', <<'EOF');

Expand Down Expand Up @@ -306,6 +306,16 @@ $s = Test::Nginx::HTTP2->new();
$sid = $s->new_stream({ method => 'CONNECT' });
$frames = $s->read(all => [{ sid => $sid, fin => 1 }]);

($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
is($frame->{headers}->{':status'}, 400, 'CONNECT with scheme and path');

$s = Test::Nginx::HTTP2->new();
$sid = $s->new_stream({ headers => [
{ name => ':method', value => 'CONNECT', mode => 1 },
{ name => ':authority', value => 'localhost:' . port(8080),
mode => 1 }]});
$frames = $s->read(all => [{ sid => $sid, fin => 1 }]);

($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
is($frame->{headers}->{':status'}, 405, 'CONNECT - not allowed');

Expand Down
Loading