aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-12-15 02:28:53 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-12-15 02:28:53 +0000
commit11dde5ca2fc81a785fd5234f8aeb2e7f98980939 (patch)
tree4e99716299a8455dd5596bd0d46615484c0ba306 /actionpack
parent2703d55935f924744e776b7714e5b40c09eb84a6 (diff)
downloadrails-11dde5ca2fc81a785fd5234f8aeb2e7f98980939.tar.gz
rails-11dde5ca2fc81a785fd5234f8aeb2e7f98980939.tar.bz2
rails-11dde5ca2fc81a785fd5234f8aeb2e7f98980939.zip
Ruby 1.9 compat: cookies
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8405 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/cgi_ext/cookie.rb6
-rwxr-xr-xactionpack/test/controller/cgi_test.rb8
2 files changed, 5 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/cgi_ext/cookie.rb b/actionpack/lib/action_controller/cgi_ext/cookie.rb
index 023f2c290b..07d2f08d5a 100644
--- a/actionpack/lib/action_controller/cgi_ext/cookie.rb
+++ b/actionpack/lib/action_controller/cgi_ext/cookie.rb
@@ -56,10 +56,6 @@ class CGI #:nodoc:
super(@value)
end
- def __setobj__(obj)
- @_dc_obj = obj
- end
-
# Set whether the Cookie is a secure cookie or not.
def secure=(val)
@secure = val == true
@@ -93,7 +89,7 @@ class CGI #:nodoc:
cookies = Hash.new([])
if raw_cookie
- raw_cookie.split(/; ?/).each do |pairs|
+ raw_cookie.split(/[;,]\s?/).each do |pairs|
name, values = pairs.split('=',2)
next unless name and values
name = CGI::unescape(name)
diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb
index cf9d5d163e..021781df98 100755
--- a/actionpack/test/controller/cgi_test.rb
+++ b/actionpack/test/controller/cgi_test.rb
@@ -72,12 +72,12 @@ class CgiRequestTest < BaseCgiTest
def test_cookie_syntax_resilience
cookies = CGI::Cookie::parse(@request_hash["HTTP_COOKIE"]);
- assert_equal ["c84ace84796670c052c6ceb2451fb0f2"], cookies["_session_id"]
- assert_equal ["yes"], cookies["is_admin"]
+ assert_equal ["c84ace84796670c052c6ceb2451fb0f2"], cookies["_session_id"], cookies.inspect
+ assert_equal ["yes"], cookies["is_admin"], cookies.inspect
alt_cookies = CGI::Cookie::parse(@alt_cookie_fmt_request_hash["HTTP_COOKIE"]);
- assert_equal ["c84ace84796670c052c6ceb2451fb0f2"], alt_cookies["_session_id"]
- assert_equal ["yes"], alt_cookies["is_admin"]
+ assert_equal ["c84ace84796670c052c6ceb2451fb0f2"], alt_cookies["_session_id"], alt_cookies.inspect
+ assert_equal ["yes"], alt_cookies["is_admin"], alt_cookies.inspect
end
end