Project

General

Profile

Bug #8182 » xmlrpc_client.rb.bug8182.patch

drbrain (Eric Hodel), 06/12/2013 08:46 AM

View differences:

lib/xmlrpc/client.rb (working copy)
@http_last_response = resp
content_encoding = resp['Content-Encoding']
data = resp.body
if resp.code == "401"
......
end
end
expected = resp["Content-Length"] || "<unknown>"
expected =
if %w[deflate gzip x-gzip].include? content_encoding then
"<unknown>"
else
resp["Content-Length"] || "<unknown>"
end
if data.nil? or data.bytesize == 0
raise "Wrong size. Was #{data.bytesize}, should be #{expected}"
elsif expected != "<unknown>" and expected.to_i != data.bytesize and resp["Transfer-Encoding"].nil?
(3-3/3)