Subject: | Patch: Silence warnings from must_keepalive() |
Date: | Mon, 28 Sep 2015 16:21:19 -0700 |
To: | bug-POE-Component-Server-SimpleHTTP [...] rt.cpan.org |
From: | Adrian Yee <adrian [...] gt.net> |
A simple patch to silence warnings from must_keepalive().
HTTP::Request->header() (inherited from HTTP::Header->header()) returns
undef if the requested header doesn't exist. Patch also attached.
Adrian
--- POE/Component/Server/SimpleHTTP.pm.orig 2015-09-28
16:06:40.535414946 -0700
+++ POE/Component/Server/SimpleHTTP.pm 2015-09-28 16:12:03.682432103 -0700
@@ -797,11 +797,11 @@
return 0 if $resp->is_error;
# Connection is a comma-seperated header
- my $conn = lc $req->header('Connection');
+ my $conn = lc ($req->header('Connection') || '');
return 0 if ",$conn," =~ /,\s*close\s*,/;
- $conn = lc $req->header('Proxy-Connection');
+ $conn = lc ($req->header('Proxy-Connection') || '');
return 0 if ",$conn," =~ /,\s*close\s*,/;
- $conn = lc $resp->header('Connection');
+ $conn = lc ($resp->header('Connection') || '');
return 0 if ",$conn," =~ /,\s*close\s*,/;
# HTTP/1.1 = keep
Message body is not shown because sender requested not to inline it.