summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2021-11-24 11:41:55 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2021-11-24 11:41:55 +0000
commit02c341c9bc5879eae568ed2ba02cf227ed948199 (patch)
tree22f67cd16d65079c3ebcbeafdebae9b01482cb6c
parent1fbf663b00bf1bdde4ebbbf0875dd7d37b0d90c6 (diff)
When parsing cookies, only decode the valuesruby_2_6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/cgi/cookie.rb1
-rw-r--r--test/cgi/test_cgi_cookie.rb5
-rw-r--r--version.h2
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/cgi/cookie.rb b/lib/cgi/cookie.rb
index 9a0d41e2b85..9e0908386e9 100644
--- a/lib/cgi/cookie.rb
+++ b/lib/cgi/cookie.rb
@@ -165,7 +165,6 @@ class CGI
raw_cookie.split(/;\s?/).each do |pairs|
name, values = pairs.split('=',2)
next unless name and values
- name = CGI.unescape(name)
values ||= ""
values = values.split('&').collect{|v| CGI.unescape(v,@@accept_charset) }
if cookies.has_key?(name)
diff --git a/test/cgi/test_cgi_cookie.rb b/test/cgi/test_cgi_cookie.rb
index 115a57e4a10..985cc0d7a1a 100644
--- a/test/cgi/test_cgi_cookie.rb
+++ b/test/cgi/test_cgi_cookie.rb
@@ -101,6 +101,11 @@ class CGICookieTest < Test::Unit::TestCase
end
end
+ def test_cgi_cookie_parse_not_decode_name
+ cookie_str = "%66oo=baz;foo=bar"
+ cookies = CGI::Cookie.parse(cookie_str)
+ assert_equal({"%66oo" => ["baz"], "foo" => ["bar"]}, cookies)
+ end
def test_cgi_cookie_arrayinterface
cookie = CGI::Cookie.new('name1', 'a', 'b', 'c')
diff --git a/version.h b/version.h
index ae731881eb0..5918d07ced9 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.6.9"
#define RUBY_RELEASE_DATE "2021-11-24"
-#define RUBY_PATCHLEVEL 206
+#define RUBY_PATCHLEVEL 207
#define RUBY_RELEASE_YEAR 2021
#define RUBY_RELEASE_MONTH 11