1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2008-04-15 17:10:38 +00:00
parent 65e137a74c
commit dd0eebd62a
3 changed files with 109 additions and 2 deletions

View file

@ -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