changeset 727:3e034902ebe7

Tests: added HTTP/2 test with invalid PROXY protocol string.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 01 Oct 2015 17:43:54 +0300
parents 22b06c04b37f
children 61800918f647
files h2.t
diffstat 1 files changed, 11 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(210);
+	->has_daemon('openssl')->plan(212);
 
 # FreeBSD has a bug in not treating zero iovcnt as EINVAL
 
@@ -1907,6 +1907,16 @@ is($frame->{headers}->{':status'}, 200, 
 
 # some invalid cases below
 
+# invalid PROXY protocol string
+
+$sess = new_session(8082, proxy => 'bogus');
+$sid = new_stream($sess, { path => '/pp' });
+$frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
+
+($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
+ok($frame, 'invalid PROXY - GOAWAY frame');
+is($frame->{code}, 1, 'invalid PROXY - error code');
+
 # ensure that request header field value with newline doesn't get split
 #
 # 10.3.  Intermediary Encapsulation Attacks