From 066226e97c1a08f927f62ae50d7e95a9ada4f303 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 29 Mar 2009 19:01:24 -0700 Subject: http11: use :http_body instead of "HTTP_BODY" "HTTP_BODY" could conflict with a "Body:" HTTP header if there ever is one. Also, try to hide this body from the Rack environment before @app is called since it is only used by Unicorn internally. --- lib/unicorn/const.rb | 3 --- lib/unicorn/http_request.rb | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/unicorn/const.rb b/lib/unicorn/const.rb index f2143bf..3a3d143 100644 --- a/lib/unicorn/const.rb +++ b/lib/unicorn/const.rb @@ -54,9 +54,6 @@ module Unicorn # This is the part of the path after the SCRIPT_NAME. PATH_INFO="PATH_INFO".freeze - # Request body - HTTP_BODY="HTTP_BODY".freeze - # The original URI requested by the client. REQUEST_URI='REQUEST_URI'.freeze REQUEST_PATH='REQUEST_PATH'.freeze diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb index 70378ef..750deea 100644 --- a/lib/unicorn/http_request.rb +++ b/lib/unicorn/http_request.rb @@ -83,7 +83,7 @@ module Unicorn # Handles dealing with the rest of the request # returns a Rack environment if successful, raises an exception if not def handle_body(socket) - http_body = @params[Const::HTTP_BODY] + http_body = @params.delete(:http_body) content_length = @params[Const::CONTENT_LENGTH].to_i remain = content_length - http_body.length -- cgit v1.2.3-24-ge0c7