+1,
I introduced this error in the content-type patch. I remember reading
rack doc, but somehow I missed the content_type method.
I'm glad you caught it and could verify it worked.
On Fri, 2009-07-17 at 15:40 +0200, Christian Hofstaedtler wrote:
> rack never spec'd HTTP_CONTENT_TYPE as a valid environment variable, but only
> CONTENT_TYPE, so we were using the wrong variable from the start.
>
> Passenger HEAD has removed support for HTTP_CONTENT_TYPE, and I've verified
> that the new way for checking the content type also works with Passenger
> 2.2.2.
>
> ---
> 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 f2ba393..1047512 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 126b301..e916712 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
>
--
Brice Figureau
My Blog: http://www.masterzen.fr/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---