Mercurial > hg > nginx-tests
changeset 1327:ecbd984ffe04
Tests: added HTTP/2 test for server push with original scheme.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 21 May 2018 13:14:57 +0300 |
parents | fda0bf1cc601 |
children | a682c219af45 |
files | h2_server_push.t |
diffstat | 1 files changed, 19 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/h2_server_push.t Mon May 21 13:05:27 2018 +0300 +++ b/h2_server_push.t Mon May 21 13:14:57 2018 +0300 @@ -134,7 +134,7 @@ $t->write_file('t2', 'SEE-THIS'); $t->write_file('explf', join('', map { sprintf "X%06dXXX", $_ } (1 .. 6553))); -$t->try_run('no http2_push')->plan(41); +$t->try_run('no http2_push')->plan(42); ############################################################################### @@ -407,6 +407,24 @@ ($frame) = grep { $_->{type} eq "DATA" && $_->{sid} == 2 } @$frames; gunzip_like($frame->{data}, qr/^PROMISED\Z/, 'gzip - response'); +# scheme https + +TODO: { +local $TODO = 'not yet'; + +$s = Test::Nginx::HTTP2->new(); +$sid = $s->new_stream({ headers => [ + { name => ':method', value => 'GET', mode => 0 }, + { name => ':scheme', value => 'https', mode => 0 }, + { name => ':path', value => '/preload' }, + { name => ':authority', value => 'localhost', mode => 1 }]}); +$frames = $s->read(all => [{ sid => 2, fin => 1 }]); + +($frame) = grep { $_->{type} eq "PUSH_PROMISE" && $_->{sid} == $sid } @$frames; +is($frame->{headers}->{':scheme'}, 'https', 'scheme https'); + +} + ############################################################################### sub gunzip_like {