diff options
author | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-08 01:04:52 +0000 |
---|---|---|
committer | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-08 01:04:52 +0000 |
commit | 1838ddd7aec73c111e5d8bc12efc1e14bc893384 (patch) | |
tree | 7d70299bf7423bda3d51b2d450f79f206e13b301 /lib | |
parent | f7c45562530faa69a05fceabdab26984011d06a6 (diff) |
* lib/webrick/cookie.rb (WEBrick::Cookie.parse_set_cookies): new
method to parse multiple cookies per Set-Cookie header.
Thanks to Aaron Patterson <aaron_patterson at speakeasy.net>.
[ruby-core:08802]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/webrick/cookie.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/webrick/cookie.rb b/lib/webrick/cookie.rb index b9663dc791..814e6645a3 100644 --- a/lib/webrick/cookie.rb +++ b/lib/webrick/cookie.rb @@ -100,5 +100,11 @@ module WEBrick } return cookie end + + def self.parse_set_cookies(str) + return str.split(/,(?=[^;,]*=)|,$/).collect{|c| + parse_set_cookie(c) + } + end end end |