Subject: | HTTP::Tiny::Mech::get misbehaves when receiving less than 2 args |
The code
sub get {
my ( $self, $uri, $opts ) = @_;
return $self->_unwrap_response( $self->mechua->get( $uri, $opts ) );
}
misbehaves when $opts is undef due to @_ being less than 3. This causes
WWW::Mechanize to interpret the arguments to get as a $uri followed by
an invalid key-without-value hash, causing a `die` in HTTP::Headers.
Replacing the get sub with
sub get {
my ( $self ) = shift;
return $self->_unwrap_response( $self->mechua->get( @_ ) );
}
behaves correctly. Fixes breakage on MetaCPAN::API::fetch, which calls
get on an HTTP::Tiny::Mech instance with only one argument.