提交 dfa45ce7 编写于 作者: R Rafael Mendonça França

Merge pull request #17792 from rockrep/master

allow 'all' for :domain option in addition to :all
......@@ -283,7 +283,7 @@ def update(other_hash)
def handle_options(options) #:nodoc:
options[:path] ||= "/"
if options[:domain] == :all
if options[:domain].respond_to?(:to_sym) && options[:domain].to_sym == :all
# if there is a provided tld length then we use it otherwise default domain regexp
domain_regexp = options[:tld_length] ? /([^.]+\.?){#{options[:tld_length]}}$/ : DOMAIN_REGEXP
......
......@@ -145,11 +145,21 @@ def set_cookie_with_domain
head :ok
end
def set_cookie_with_domain_all_as_string
cookies[:user_name] = {:value => "rizwanreza", :domain => 'all'}
head :ok
end
def delete_cookie_with_domain
cookies.delete(:user_name, :domain => :all)
head :ok
end
def delete_cookie_with_domain_all_as_string
cookies.delete(:user_name, :domain => 'all')
head :ok
end
def set_cookie_with_domain_and_tld
cookies[:user_name] = {:value => "rizwanreza", :domain => :all, :tld_length => 2}
head :ok
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册