Skip to content

Commit

Permalink
handle negative values and zero the same
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 12, 2016
1 parent 8a810cd commit de600ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,6 +1,7 @@

6.65 2016-06-10
6.65 2016-06-12
- Updated jQuery to version 3.0.0.
- Fixed "0" value bug in Mojo::UserAgent::CookieJar. (jamadam)

6.64 2016-06-09
- Updated HTML5 entities in Mojo::Util.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/UserAgent/CookieJar.pm
Expand Up @@ -16,7 +16,7 @@ sub add {

# Convert max age to expires
my $age = $cookie->max_age;
$cookie->expires($age ? $age + time : 0) if looks_like_number $age;
$cookie->expires($age <= 0 ? 0 : $age + time) if looks_like_number $age;

# Check cookie size
next if length($cookie->value // '') > $size;
Expand Down

0 comments on commit de600ed

Please sign in to comment.