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};
}
}
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 );
}