From b2a8ca6dd61358ed72c3d4f5f61767052c9b4d27 Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Fri, 8 Sep 2006 01:04:52 +0000 Subject: * lib/webrick/cookie.rb (WEBrick::Cookie.parse_set_cookies): new method to parse multiple cookies per Set-Cookie header. Thanks to Aaron Patterson . [ruby-core:08802] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/webrick/cookie.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/webrick/cookie.rb') 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 -- cgit v1.2.3