diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-27 03:17:47 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-27 03:17:47 +0000 |
commit | 5f33c6b0f5e7a0e5cb849e791adced2528df3227 (patch) | |
tree | 2db80de700359282ce0101a6948e361767c3dda5 /lib | |
parent | f0137ba8cdd805249a55d371aa2309f5622b7f70 (diff) | |
download | ruby-5f33c6b0f5e7a0e5cb849e791adced2528df3227.tar.gz |
* lib/cgi/cookie.rb (parse): don't allow , as a separator. [Bug #12791]
* lib/webrick/cookie.rb (parse): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cgi/cookie.rb | 2 | ||||
-rw-r--r-- | lib/webrick/cookie.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/cgi/cookie.rb b/lib/cgi/cookie.rb index ffd88b8edb..4cc050b90d 100644 --- a/lib/cgi/cookie.rb +++ b/lib/cgi/cookie.rb @@ -162,7 +162,7 @@ class CGI cookies = Hash.new([]) return cookies unless raw_cookie - raw_cookie.split(/[;,]\s?/).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/lib/webrick/cookie.rb b/lib/webrick/cookie.rb index 16f8d21827..24bf92ec00 100644 --- a/lib/webrick/cookie.rb +++ b/lib/webrick/cookie.rb @@ -113,7 +113,7 @@ module WEBrick ret = [] cookie = nil ver = 0 - str.split(/[;,]\s+/).each{|x| + str.split(/;\s+/).each{|x| key, val = x.split(/=/,2) val = val ? HTTPUtils::dequote(val) : "" case key |