changeset 852:e0d6ba59968f

Tests: added HTTP/2 proxy test with logging request headers.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 09 Feb 2016 14:24:47 +0300
parents 940757cf34f5
children b5c8739961c9
files h2.t
diffstat 1 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h2.t
+++ b/h2.t
@@ -32,7 +32,7 @@ plan(skip_all => 'IO::Socket::SSL too ol
 
 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/)
 	->has(qw/limit_conn rewrite realip shmem/)
-	->has_daemon('openssl')->plan(314);
+	->has_daemon('openssl')->plan(316);
 
 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL
 
@@ -1938,6 +1938,26 @@ h2_body($sess, 'TESTTEST123', { body_pad
 is($frame->{headers}->{':status'}, 413,
 	'request body without content-length many pad - limited');
 
+# proxied request with logging pristine request header field (e.g., referer)
+
+$sess = new_session();
+$sid = new_stream($sess, { headers => [
+	{ name => ':method', value => 'GET' },
+	{ name => ':scheme', value => 'http' },
+	{ name => ':path', value => '/proxy2/' },
+	{ name => ':authority', value => 'localhost' },
+	{ name => 'referer', value => 'foo' }]});
+$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
+
+($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
+is($frame->{headers}->{':status'}, 200, 'proxy with logging request headers');
+
+$sid = new_stream($sess);
+$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
+
+($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
+ok($frame->{headers}, 'proxy with logging request headers - next');
+
 # initial window size, client side
 
 # 6.9.2.  Initial Flow-Control Window Size