# HG changeset patch # User Sergey Kandaurov # Date 1521130210 -10800 # Node ID 84a661563eaee244ecee7463fa2f40e9b2b52beb # Parent a94a0fc60d56ea7374487eaa624040a19352f157 Tests: allow to set empty HTTP/2 connection preface. diff --git a/lib/Test/Nginx/HTTP2.pm b/lib/Test/Nginx/HTTP2.pm --- a/lib/Test/Nginx/HTTP2.pm +++ b/lib/Test/Nginx/HTTP2.pm @@ -36,8 +36,8 @@ sub new { my ($port, %extra) = @_; my $s = $extra{socket} || new_socket($port, %extra); - my $preface = $extra{preface} - || 'PRI * HTTP/2.0' . CRLF . CRLF . 'SM' . CRLF . CRLF; + my $preface = defined $extra{preface} ? $extra{preface} + : 'PRI * HTTP/2.0' . CRLF . CRLF . 'SM' . CRLF . CRLF; if ($extra{proxy}) { raw_write($s, $extra{proxy});