Browse files

fix cookie extension for Rack 1.5

  • Loading branch information...
1 parent 38738b7 commit c65ab611a5de74787618ad55ad755efeee4bdf6c @rkh committed Mar 16, 2013
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/sinatra/cookies.rb
  2. +2 −2 spec/cookies_spec.rb
View
2 lib/sinatra/cookies.rb
@@ -305,7 +305,7 @@ def parse_response
key, value = line.split(';', 2).first.to_s.split('=', 2)
next if key.nil?
key = Rack::Utils.unescape(key)
- if line.include? "expires=Thu, 01-Jan-1970 00:00:00 GMT"
+ if line =~ /expires=Thu, 01[-\s]Jan[-\s]1970/
@deleted << key
else
@deleted.delete key
View
4 spec/cookies_spec.rb
@@ -158,7 +158,7 @@ def cookies(*set_cookies)
cookie_route("foo=bar") do
cookies.clear
response['Set-Cookie']
- end.should include("foo=;", "expires=Thu, 01-Jan-1970 00:00:00 GMT")
+ end.should include("foo=;", "expires=", "1970 00:00:00")
end
end
@@ -194,7 +194,7 @@ def cookies(*set_cookies)
cookie_route("foo=bar") do
cookies.delete 'foo'
response['Set-Cookie']
- end.should include("foo=;", "expires=Thu, 01-Jan-1970 00:00:00 GMT")
+ end.should include("foo=;", "expires=", "1970 00:00:00")
end
it 'honours the app cookie_options' do

0 comments on commit c65ab61

Please sign in to comment.