Skip to content

Commit

Permalink
fix invalid #expired? method
Browse files Browse the repository at this point in the history
Conflicts:
	src/http/cookie.cr
  • Loading branch information
bmmcginty committed Jun 19, 2018
1 parent 8959b54 commit 354bc8c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/http/cookie.cr
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ module HTTP
end
end

# returns the expiration status of this cookie as a `Bool` given a creation time
def expired?(time_reference = @creation_time)
if @max_age == 0.seconds
true
elsif (time = expiration_time(time_reference)) && time < Time.now
true
else
false
end
end

# :nodoc:
module Parser
module Regex
Expand Down

0 comments on commit 354bc8c

Please sign in to comment.