mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
make CGI::Cookie handle deleting a cookie properly
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
This commit is contained in:
parent
d16fbe53b2
commit
d8bcec6ce6
2 changed files with 2 additions and 1 deletions
|
@ -37,7 +37,7 @@ class CGI #:nodoc:
|
|||
@path = nil
|
||||
else
|
||||
@name = name['name']
|
||||
@value = name['value'].kind_of?(String) ? [name['value']] : Array(name['value'])
|
||||
@value = (name['value'].kind_of?(String) ? [name['value']] : Array(name['value'])).delete_if(&:blank?)
|
||||
@domain = name['domain']
|
||||
@expires = name['expires']
|
||||
@secure = name['secure'] || false
|
||||
|
|
|
@ -82,6 +82,7 @@ class CookieTest < Test::Unit::TestCase
|
|||
def test_expiring_cookie
|
||||
get :logout
|
||||
assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "", "expires" => Time.at(0)) ], @response.headers["cookie"]
|
||||
assert_equal CGI::Cookie::new("name" => "user_name", "value" => "", "expires" => Time.at(0)).value, []
|
||||
end
|
||||
|
||||
def test_cookiejar_accessor
|
||||
|
|
Loading…
Reference in a new issue