mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-03-25 08:55:53 +00:00
HTTP::Cookie#origin=: Acceptability check must be performed after setting the domain and path.
This commit is contained in:
parent
fa45e028a7
commit
82deac2f19
1 changed files with 2 additions and 2 deletions
|
|
@ -307,10 +307,10 @@ class HTTP::Cookie
|
|||
@origin.nil? or
|
||||
raise ArgumentError, "origin cannot be changed once it is set"
|
||||
origin = URI(origin)
|
||||
acceptable_from_uri?(origin) or
|
||||
raise ArgumentError, "unacceptable cookie sent from URI #{origin}"
|
||||
self.domain ||= origin.host
|
||||
self.path ||= (normalize_uri_path(origin) + './').path
|
||||
acceptable_from_uri?(origin) or
|
||||
raise ArgumentError, "unacceptable cookie sent from URI #{origin}"
|
||||
@origin = origin
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue