Skip to content

Commit

Permalink
fix handling of invalid URLs in Mojo::UserAgent::CookieJar
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 13, 2015
1 parent 72d0bc1 commit 08d5f42
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes
@@ -1,5 +1,6 @@

6.31 2015-11-13
- Fixed handling of invalid URLs in Mojo::UserAgent::CookieJar.
- Fixed a few small selector bugs in Mojo::DOM::CSS.

6.30 2015-11-11
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/UserAgent/CookieJar.pm
Expand Up @@ -100,7 +100,7 @@ sub find {
}

# Remove another part
continue { $domain =~ s/^[^.]+\.?// }
continue { $domain =~ s/^[^.]+\.*// }

return \@found;
}
Expand Down
4 changes: 4 additions & 0 deletions t/mojo/cookiejar.t
Expand Up @@ -255,6 +255,10 @@ $tx = Mojo::Transaction::HTTP->new;
$tx->req->url->parse('http://mojolicio.us/whatever');
$jar->prepare($tx);
is $tx->req->cookie('foo'), undef, 'no cookie';
$tx = Mojo::Transaction::HTTP->new;
$tx->req->url->parse('http://manydots...');
$jar->prepare($tx);
is $tx->req->cookie('foo'), undef, 'no cookie';

# Gather and prepare cookies with same name (with and without domain)
$jar = Mojo::UserAgent::CookieJar->new;
Expand Down

0 comments on commit 08d5f42

Please sign in to comment.