Skip Menu |

This queue is for tickets about the HTTP-Cookies CPAN distribution.

Report information
The Basics
Id: 99453
Status: resolved
Priority: 0/
Queue: HTTP-Cookies

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: extract_cookies croaks for file: addresses
#!/usr/bin/perl use HTTP::Cookies; use HTTP::Response; use HTTP::Request::Common; my $jar = new HTTP::Cookies; my $res = new HTTP::Response 200, undef, [ set_cookie => 'foo=bar' ]; $res->request(GET 'file:///tmp/foo.html'); $jar->extract_cookies($res); print $jar->as_string; __END__ Output: Can't locate object method "port" via package "URI::file" at /System/Library/Perl/Extras/5.12/HTTP/Cookies.pm line 188. Should URI::file have a port method returning undef? Or should the ->port call be wrapped in an eval?
Subject: Re: [rt.cpan.org #99453] extract_cookies croaks for file: addresses
Date: Sun, 12 Oct 2014 17:41:56 -0700
To: Father Chrysostomos via RT <bug-HTTP-Cookies [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Sun, Oct 12, 2014 at 08:20:47PM -0400, Father Chrysostomos via RT wrote: Show quoted text
> Output: > > Can't locate object method "port" via package "URI::file" at /System/Library/Perl/Extras/5.12/HTTP/Cookies.pm line 188. > > Should URI::file have a port method returning undef? Or should the ->port call be wrapped in an eval?
The latter, I think -- generally only specific URI subclasses implement the interfaces relevant to them, with the expectation that caller uses ->can or ->isa on the $uri object first.