From cc8bc6b7b6cb429c6a0a4bebc180b70b564e4e99 Mon Sep 17 00:00:00 2001 From: nahi Date: Fri, 1 Apr 2011 10:02:03 +0000 Subject: Fri Apr 1 18:53:06 2011 NAKAMURA, Hiroshi * lib/webrick/cookie.rb (WEBrick::Cookie.parse): 'white space is permitted between tokens' according to RFC2965. Though 'Netscape spec' does not define the syntax clearly, make it tolerant as a server. As a real-world example, rest-client gem sends 'Cookie: foo=1;bar=2' * test/webrick/test_cookie.rb (test_parse_non_whitespace): test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/webrick/cookie.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/webrick/cookie.rb b/lib/webrick/cookie.rb index 814e6645a3..eb3b63b006 100644 --- a/lib/webrick/cookie.rb +++ b/lib/webrick/cookie.rb @@ -57,7 +57,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 -- cgit v1.2.3