From ca17b3c4dec9a095b7e1bf24a55edbaaa6561a00 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Fri, 17 Jul 2009 13:31:56 +0200 Subject: rack: don't directly use the forbidden HTTP_CONTENT_TYPE env var (fixes rack specification conformance) --- lib/puppet/network/http/rack/rest.rb | 2 +- spec/unit/network/http/rack/rest.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/puppet/network/http/rack/rest.rb b/lib/puppet/network/http/rack/rest.rb index f2ba39336..104751271 100644 --- a/lib/puppet/network/http/rack/rest.rb +++ b/lib/puppet/network/http/rack/rest.rb @@ -30,7 +30,7 @@ class Puppet::Network::HTTP::RackREST < Puppet::Network::HTTP::RackHttpHandler # Retrieve the accept header from the http request. def content_type_header(request) - request.env['HTTP_CONTENT_TYPE'] + request.content_type end # Return which HTTP verb was used in this request. diff --git a/spec/unit/network/http/rack/rest.rb b/spec/unit/network/http/rack/rest.rb index 126b30152..e916712f3 100755 --- a/spec/unit/network/http/rack/rest.rb +++ b/spec/unit/network/http/rack/rest.rb @@ -40,8 +40,8 @@ describe "Puppet::Network::HTTP::RackREST" do @handler.accept_header(req).should == "myaccept" end - it "should return the HTTP_CONTENT_TYPE parameter as the content type header" do - req = mk_req('/', 'HTTP_CONTENT_TYPE' => 'mycontent') + it "should return the CONTENT_TYPE parameter as the content type header" do + req = mk_req('/', 'CONTENT_TYPE' => 'mycontent') @handler.content_type_header(req).should == "mycontent" end -- cgit