Skip to content

Commit

Permalink
no need to check the URL so early
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 25, 2016
1 parent dcedecf commit d87c59f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

7.01 2016-07-22
7.01 2016-07-26

7.0 2016-07-19
- Code name "Doughnut", this is a major release.
Expand Down
9 changes: 4 additions & 5 deletions lib/Mojo/UserAgent/Transactor.pm
Expand Up @@ -97,14 +97,13 @@ sub redirect {
}

sub tx {
my $self = shift;
my ($self, $method, $url) = (shift, shift, shift);

# Method and URL
my $tx = Mojo::Transaction::HTTP->new;
my $req = $tx->req->method(shift);
my $url = shift;
$url = "http://$url" unless $url =~ m!^/|://!;
ref $url ? $req->url($url) : $req->url->parse($url);
my $req = $tx->req->method($method);
if (ref $url) { $req->url($url) }
else { $req->url->parse($url =~ m!^/|://! ? $url : "http://$url") }

# Headers (we identify ourselves and accept gzip compression)
my $headers = $req->headers;
Expand Down

0 comments on commit d87c59f

Please sign in to comment.