aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xmlrpc
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-06 22:45:43 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-06 22:45:43 +0000
commit9e9264c8d55b63e1033ed1a415ca9280744cf446 (patch)
tree7d81b9b7e1bdf99d00c95e4f4a56ee9d3e711985 /lib/xmlrpc
parent8029539d029fc36ff8d09cc88ce821c7b4c6035f (diff)
downloadruby-9e9264c8d55b63e1033ed1a415ca9280744cf446.tar.gz
* lib/xmlrpc/client.rb: assume servers that do not send a Content-Type
header are sending 'text/xml'. Thanks Nathan Leavitt! [ruby-core:41204] [Bug #5660] * test/xmlrpc/test_client.rb: supporting test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/xmlrpc')
-rw-r--r--lib/xmlrpc/client.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/xmlrpc/client.rb b/lib/xmlrpc/client.rb
index 8d899bc600..a75067ab8b 100644
--- a/lib/xmlrpc/client.rb
+++ b/lib/xmlrpc/client.rb
@@ -556,7 +556,9 @@ module XMLRPC
raise "HTTP-Error: #{resp.code} #{resp.message}"
end
- ct = parse_content_type(resp["Content-Type"]).first
+ # assume text/xml on instances where Content-Type header is not set
+ ct_expected = resp["Content-Type"] || 'text/xml'
+ ct = parse_content_type(ct_expected).first
if ct != "text/xml"
if ct == "text/html"
raise "Wrong content-type (received '#{ct}' but expected 'text/xml'): \n#{data}"