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 | b2a8ca6dd61358ed72c3d4f5f61767052c9b4d27 (patch) | |
tree | 2808640321b4b71eb9e172f54107728919167c99 /lib/webrick/cookie.rb | |
parent | eba74dc219404e746f5e9273794e27c71be003db (diff) | |
download | ruby-b2a8ca6dd61358ed72c3d4f5f61767052c9b4d27.tar.gz |
* 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/trunk@10885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/cookie.rb')
-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 |