Cookie#origin=: Add a comment to explain why @origin is set the last.

This commit is contained in:
Akinori MUSHA 2013-04-18 22:23:30 +09:00
parent a0202e2192
commit 3d4f0a65ff

View file

@ -447,6 +447,7 @@ class HTTP::Cookie
return origin if origin == @origin
@origin.nil? or
raise ArgumentError, "origin cannot be changed once it is set"
# Delay setting @origin because #domain= or #path= may fail
origin = URI(origin)
if URI::HTTP === origin
self.domain ||= origin.host