Skip to content

Commit 25b7a70

Browse files
committed
Tests: added HTTP/2 test for server push with original scheme.
1 parent 64f096c commit 25b7a70

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

h2_server_push.t

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ $t->write_file('t1', join('', map { sprintf "X%04dXXX", $_ } (1 .. 8202)));
134134
$t->write_file('t2', 'SEE-THIS');
135135
$t->write_file('explf', join('', map { sprintf "X%06dXXX", $_ } (1 .. 6553)));
136136

137-
$t->try_run('no http2_push')->plan(41);
137+
$t->try_run('no http2_push')->plan(42);
138138

139139
###############################################################################
140140

@@ -407,6 +407,24 @@ is($frame->{headers}->{'content-encoding'}, 'gzip', 'gzip - headers');
407407
($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == 2 } @$frames;
408408
gunzip_like($frame->{data}, qr/^PROMISED\Z/, 'gzip - response');
409409

410+
# scheme https
411+
412+
TODO: {
413+
local $TODO = 'not yet';
414+
415+
$s = Test::Nginx::HTTP2->new();
416+
$sid = $s->new_stream({ headers => [
417+
{ name => ':method', value => 'GET', mode => 0 },
418+
{ name => ':scheme', value => 'https', mode => 0 },
419+
{ name => ':path', value => '/preload' },
420+
{ name => ':authority', value => 'localhost', mode => 1 }]});
421+
$frames = $s->read(all => [{ sid => 2, fin => 1 }]);
422+
423+
($frame) = grep { $_->{type} eq "PUSH_PROMISE" && $_->{sid} == $sid } @$frames;
424+
is($frame->{headers}->{':scheme'}, 'https', 'scheme https');
425+
426+
}
427+
410428
###############################################################################
411429

412430
sub gunzip_like {

0 commit comments

Comments
 (0)