# HG changeset patch # User Sergey Kandaurov # Date 1466006445 -10800 # Node ID e3df9c2100de80beb752e15b90aa0db79bd05bc6 # Parent d73bef563aea473f77ca5d960ccd36fd648c0c86 Tests: fixed HTTP/2 test with invalid PROXY protocol string. Previously it tested invalid connection preface. diff --git a/h2_proxy_protocol.t b/h2_proxy_protocol.t --- a/h2_proxy_protocol.t +++ b/h2_proxy_protocol.t @@ -39,7 +39,6 @@ http { %%TEST_GLOBALS_HTTP%% server { - listen 127.0.0.1:8080 http2; listen 127.0.0.1:8081 proxy_protocol http2; server_name localhost; @@ -70,8 +69,9 @@ is($frame->{headers}->{'x-pp'}, '192.0.2 # invalid PROXY protocol string -my $s = http('BOGUS TCP4 192.0.2.1 192.0.2.2 1234 5678', start => 1); -$frames = h2_read({ socket => $s }, all => [{ type => 'GOAWAY' }]); +$proxy = 'BOGUS TCP4 192.0.2.1 192.0.2.2 1234 5678' . CRLF; +$sess = new_session(8081, preface => $proxy, pure => 1); +$frames = h2_read($sess, all => [{ type => 'GOAWAY' }]); ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; ok($frame, 'invalid PROXY - GOAWAY frame');