Skip to content

Commit

Permalink
no need to check via_proxy first
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 21, 2015
1 parent 75fe9eb commit 5583faf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/Message/Request.pm
Expand Up @@ -76,7 +76,7 @@ sub fix_headers {
}

# Basic proxy authentication
return $self unless $self->via_proxy && (my $proxy = $self->proxy);
return $self unless (my $proxy = $self->proxy) && $self->via_proxy;
return $self unless my $info = $proxy->userinfo;
$headers->proxy_authorization('Basic ' . b64_encode($info, ''))
unless $headers->proxy_authorization;
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/UserAgent/Transactor.pm
Expand Up @@ -47,7 +47,7 @@ sub proxy_connect {
return undef if uc $req->method eq 'CONNECT';

# No proxy
return undef unless $req->via_proxy && (my $proxy = $req->proxy);
return undef unless (my $proxy = $req->proxy) && $req->via_proxy;
return undef if $proxy->protocol eq 'socks';

# WebSocket and/or HTTPS
Expand Down

0 comments on commit 5583faf

Please sign in to comment.