mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-03-31 09:55:58 +00:00
Apply minor code improvements.
This commit is contained in:
parent
9768154e82
commit
1a7c38e9e0
1 changed files with 3 additions and 3 deletions
|
|
@ -180,14 +180,14 @@ class HTTP::Cookie
|
|||
date ||= Time.now
|
||||
|
||||
[].tap { |cookies|
|
||||
set_cookie.split(/,(?=[^;,]*=)|,$/).each { |c|
|
||||
# The expires attribute may include a comma in the value.
|
||||
set_cookie.split(/,(?=[^;,]*=|\s*\z)/).each { |c|
|
||||
if c.bytesize > MAX_LENGTH
|
||||
logger.warn("Cookie definition too long: #{c}") if logger
|
||||
next
|
||||
end
|
||||
|
||||
cookie_elem = c.split(/;+/)
|
||||
first_elem = cookie_elem.shift
|
||||
first_elem, *cookie_elem = c.split(/;+/)
|
||||
first_elem.strip!
|
||||
key, value = first_elem.split(/\=/, 2)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue