Mercurial > hg > nginx-tests
comparison lib/Test/Nginx/HTTP2.pm @ 1298:84a661563eae
Tests: allow to set empty HTTP/2 connection preface.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 15 Mar 2018 19:10:10 +0300 |
parents | 6d065c9a3b1f |
children | 28e5f1fa80e1 |
comparison
equal
deleted
inserted
replaced
1297:a94a0fc60d56 | 1298:84a661563eae |
---|---|
34 sub new { | 34 sub new { |
35 my $class = shift; | 35 my $class = shift; |
36 my ($port, %extra) = @_; | 36 my ($port, %extra) = @_; |
37 | 37 |
38 my $s = $extra{socket} || new_socket($port, %extra); | 38 my $s = $extra{socket} || new_socket($port, %extra); |
39 my $preface = $extra{preface} | 39 my $preface = defined $extra{preface} ? $extra{preface} |
40 || 'PRI * HTTP/2.0' . CRLF . CRLF . 'SM' . CRLF . CRLF; | 40 : 'PRI * HTTP/2.0' . CRLF . CRLF . 'SM' . CRLF . CRLF; |
41 | 41 |
42 if ($extra{proxy}) { | 42 if ($extra{proxy}) { |
43 raw_write($s, $extra{proxy}); | 43 raw_write($s, $extra{proxy}); |
44 } | 44 } |
45 | 45 |