sub import {
my ($self, $class, $opts) = @_;
$import->($self, '-all' => { class => $class });
- $opts ||= {};
+ $opts = {} unless ref $opts eq 'HASH';
$default_host = $opts->{default_host} if exists $opts->{default_host};
}
}
keep_alive => 1,
max_redirect => 0,
timeout => 60,
+
+ # work around newer LWP max_redirect 0 bug
+ # http://rt.cpan.org/Ticket/Display.html?id=40260
+ requests_redirectable => [],
);
$agent->env_proxy;
sub _customize_request {
my $request = shift;
my $opts = pop(@_) || {};
+ $opts = {} unless ref($opts) eq 'HASH';
if ( my $host = exists $opts->{host} ? $opts->{host} : $default_host ) {
$request->header( 'Host' => $host );
}