mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-04-27 14:57:46 +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
|
@origin.nil? or
|
||||||
raise ArgumentError, "origin cannot be changed once it is set"
|
raise ArgumentError, "origin cannot be changed once it is set"
|
||||||
origin = URI(origin)
|
origin = URI(origin)
|
||||||
acceptable_from_uri?(origin) or
|
|
||||||
raise ArgumentError, "unacceptable cookie sent from URI #{origin}"
|
|
||||||
self.domain ||= origin.host
|
self.domain ||= origin.host
|
||||||
self.path ||= (normalize_uri_path(origin) + './').path
|
self.path ||= (normalize_uri_path(origin) + './').path
|
||||||
|
acceptable_from_uri?(origin) or
|
||||||
|
raise ArgumentError, "unacceptable cookie sent from URI #{origin}"
|
||||||
@origin = origin
|
@origin = origin
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue