--- AnyEvent-HTTP/HTTP.pm 2015/05/08 17:34:35 1.123 +++ AnyEvent-HTTP/HTTP.pm 2016/01/07 13:14:16 1.126 @@ -48,7 +48,7 @@ use base Exporter::; -our $VERSION = 2.21; +our $VERSION = 2.22; our @EXPORT = qw(http_get http_post http_head http_request); @@ -775,7 +775,7 @@ : $uscheme eq "https" ? 443 : return $cb->(undef, { @pseudo, Status => 599, Reason => "Only http and https URL schemes supported" }); - $uauthority =~ /^(?: .*\@ )? ([^\@:]+) (?: : (\d+) )?$/x + $uauthority =~ /^(?: .*\@ )? ([^\@]+?) (?: : (\d+) )?$/x or return $cb->(undef, { @pseudo, Status => 599, Reason => "Unparsable URL" }); my $uhost = lc $1; @@ -897,7 +897,7 @@ my $loc = $hdr{location}; if ($loc =~ m%^//%) { # // - $loc = "$rscheme:$loc"; + $loc = "$uscheme:$loc"; } elsif ($loc eq "") { $loc = $url; @@ -906,7 +906,7 @@ $loc =~ s/^\.\/+//; if ($loc !~ m%^[.?#]%) { - my $prefix = "$rscheme://$uhost:$uport"; + my $prefix = "$uscheme://$uhost:$uport"; unless ($loc =~ s/^\///) { $prefix .= $upath; @@ -1125,10 +1125,10 @@ %state = (); $state{recurse} = http_request ( - $method => $url, + $method => $url, %arg, - recurse => $recurse - 1, - keepalive => 0, + recurse => $recurse - 1, + persistent => 0, sub { %state = (); &$cb