diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-15 14:10:18 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-15 14:10:18 +0000 |
commit | c1fdbe0f1d86c8dc72e0d26faaed5dc66de60baa (patch) | |
tree | 26e710f160793f3c225de06163a4e68a6e23efef /lib/xmlrpc/client.rb | |
parent | 85b57498258b401a46c07d0af32ff4ea775b0ef1 (diff) | |
download | ruby-c1fdbe0f1d86c8dc72e0d26faaed5dc66de60baa.tar.gz ruby-c1fdbe0f1d86c8dc72e0d26faaed5dc66de60baa.tar.xz ruby-c1fdbe0f1d86c8dc72e0d26faaed5dc66de60baa.zip |
* lib/xmlrpc/client.rb: fix cookie handling. [ruby-dev:34403]
* test/xmlrpc/test_cookie.rb: add a test for the above fix.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/xmlrpc/client.rb')
-rw-r--r-- | lib/xmlrpc/client.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/xmlrpc/client.rb b/lib/xmlrpc/client.rb index 726945ea3..7cf2ed87a 100644 --- a/lib/xmlrpc/client.rb +++ b/lib/xmlrpc/client.rb @@ -565,8 +565,13 @@ module XMLRPC raise "Wrong size. Was #{data.size}, should be #{expected}" end - c = resp["Set-Cookie"] - @cookie = c if c + set_cookies = resp.get_fields("Set-Cookie") + if set_cookies and !set_cookies.empty? + @cookie = set_cookies.collect do |set_cookie| + cookie = WEBrick::Cookie.parse_set_cookie(set_cookie) + WEBrick::Cookie.new(cookie.name, cookie.value).to_s + end.join("; ") + end return data end |