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?