Skip to content

Commit

Permalink
another small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 21, 2013
1 parent 33e6dfe commit b0f4801
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Mojolicious/Command/get.pm
Expand Up @@ -55,13 +55,11 @@ sub run {
my %headers;
/^\s*([^:]+)\s*:\s*(.+)$/ and $headers{$1} = $2 for @headers;

# Detect proxy for absolute URLs
my $ua = Mojo::UserAgent->new(ioloop => Mojo::IOLoop->singleton);
$url !~ m!^/! ? $ua->detect_proxy : $ua->app($self->app);
$ua->max_redirects(10) if $redirect;

# Detect proxy for absolute URLs
if ($url !~ m!^/!) { $ua->detect_proxy }
else { $ua->app($self->app) }

my $buffer = '';
$ua->on(
start => sub {
Expand Down

0 comments on commit b0f4801

Please sign in to comment.