summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/http
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/network/http')
-rw-r--r--lib/puppet/network/http/handler.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb
index 27e8dbd1d..817661db1 100644
--- a/lib/puppet/network/http/handler.rb
+++ b/lib/puppet/network/http/handler.rb
@@ -42,7 +42,9 @@ module Puppet::Network::HTTP::Handler
def request_format(request)
if header = content_type_header(request)
+ header.gsub!(/\s*;.*$/,'') # strip any charset
format = Puppet::Network::FormatHandler.mime(header)
+ raise "Client sent a mime-type (%s) that doesn't correspond to a format we support" % header if format.nil?
return format.name.to_s if format.suitable?
end