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
+++ b/h2_server_push.t
@@ -134,7 +134,7 @@ EOF
 $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 @@ is($frame->{headers}->{'content-encoding
 ($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 {