Subject: | [PATCH] HTTP::Cookies produces warnings for undefined cookie param names |
HTTP::Cookies produces warnings when a malformed cookie is set.
Specifically when there is no key for a cookie param as shown
immediately preceding the "version" param in this example:
Set-Cookie3: cosign-shibboleth=8hGufDmgGkvh467qSZySOu6X4AHViO; path="/";
domain=shibboleth.somedomain.com; path_spec; discard; ; version=0
The two line patch to prevent warnings is attached.
Subject: | cookies.patch |
--- Cookies.pm.old Thu Aug 14 09:40:41 2008
+++ Cookies.pm Thu Aug 14 09:44:45 2008
@@ -218,8 +218,9 @@
my $param;
my $expires;
my $first_param = 1;
- for $param (split(/;\s*/, $set)) {
+ SET_PARAM: for $param (split(/;\s*/, $set)) {
my($k,$v) = split(/\s*=\s*/, $param, 2);
+ next SET_PARAM unless defined $k;
if (defined $v) {
$v =~ s/\s+$//;
#print "$k => $v\n";