Skip to content

Commit

Permalink
small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 8, 2014
1 parent 3107397 commit a629a38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/Mojo/Content.pm
Expand Up @@ -115,10 +115,10 @@ sub parse {
# Relaxed parsing
my $headers = $self->headers;
if ($self->auto_relax) {
my $connection = $headers->connection // '';
my $len = $headers->content_length // '';
my $connection = lc($headers->connection // '');
my $len = $headers->content_length // '';
$self->relaxed(1)
if !length $len && ($connection =~ /close/i || $headers->content_type);
if !length $len && ($connection eq 'close' || $headers->content_type);
}

# Chunked or relaxed content
Expand Down
3 changes: 1 addition & 2 deletions lib/Mojo/URL.pm
Expand Up @@ -44,8 +44,7 @@ sub clone {

my $clone = $self->new;
$clone->$_($self->$_) for qw(scheme userinfo host port fragment);
$clone->path($self->path->clone);
$clone->query($self->query->clone);
$clone->path($self->path->clone)->query($self->query->clone);
$clone->base($self->base->clone) if $self->{base};

return $clone;
Expand Down

0 comments on commit a629a38

Please sign in to comment.