Skip to content

Commit

Permalink
small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 26, 2012
1 parent ad9c717 commit b038e9b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -431,17 +431,17 @@ sub _server {
sub _start {
my ($self, $tx, $cb) = @_;

# Embedded server
# Embedded server (only start if necessary)
my $req = $tx->req;
if ($self->app) {
my $url = $req->url;
if ($self->app && ($self->{port} || !$url->is_abs)) {
$self->_server->app($self->app);
my $url = $req->url->to_abs;
$req->url($url->base($self->app_url)->to_abs) unless $url->is_abs;
$url = $req->url($url->base($self->app_url)->to_abs)->url
unless $url->is_abs;
}

# Proxy
$self->detect_proxy if $ENV{MOJO_PROXY};
my $url = $req->url;
my $proto = $url->protocol;
if ($self->need_proxy($url->host)) {

Expand Down

0 comments on commit b038e9b

Please sign in to comment.