summaryrefslogtreecommitdiffstats
path: root/lib/puppet/indirector/rest.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/indirector/rest.rb')
-rw-r--r--lib/puppet/indirector/rest.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/puppet/indirector/rest.rb b/lib/puppet/indirector/rest.rb
index 4d818c986..35847de88 100644
--- a/lib/puppet/indirector/rest.rb
+++ b/lib/puppet/indirector/rest.rb
@@ -41,11 +41,13 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus
raise "No content type in http response; cannot parse"
end
+ content_type = response['content-type'].gsub(/\s*;.*$/,'') # strip any appended charset
+
# Convert the response to a deserialized object.
if multiple
- model.convert_from_multiple(response['content-type'], response.body)
+ model.convert_from_multiple(content_type, response.body)
else
- model.convert_from(response['content-type'], response.body)
+ model.convert_from(content_type, response.body)
end
else
# Raise the http error if we didn't get a 'success' of some kind.