Subject: | Bug in http-cookies v6.00 |
Date: | Sun, 27 Nov 2011 21:00:27 +0200 |
To: | bug-HTTP-Cookies [...] rt.cpan.org |
From: | Artem Mus <artemmus [...] gmail.com> |
Hello
I found that if server set cookie with domain in format like this
".domain.com" and then
2) and then LWP goes to http://domain.com cookie not passed to http://domain.com
to fix it, I write this code in HTTP::Cookies.pm
sub add_cookie_header
{
my $self = shift;
my $request = shift || return;
my $url = $request->uri;
my $scheme = $url->scheme;
unless ($scheme =~ /^https?\z/) {
return;
}
my $domain = _host($request, $url);
# ARTEMMUS BUG FIX, for domain with dot in front like .site.com
$domain = '.'.$domain if $domain !~ /^\./;
# END BUG FIX
...
--
С уважением,
Artem mailto:artemmus@gmail.com