From 32d03af341eba4d0b263156f0241016b857c4d84 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 15 May 2007 21:36:21 +0000 Subject: Introduce the request.body stream. Lazy-read to parse parameters rather than always setting RAW_POST_DATA. Reduces the memory footprint of large binary PUT requests. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6740 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/cgi_ext/query_extension.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'actionpack/lib/action_controller/cgi_ext/query_extension.rb') diff --git a/actionpack/lib/action_controller/cgi_ext/query_extension.rb b/actionpack/lib/action_controller/cgi_ext/query_extension.rb index 9e836eaaf8..147530b5ce 100644 --- a/actionpack/lib/action_controller/cgi_ext/query_extension.rb +++ b/actionpack/lib/action_controller/cgi_ext/query_extension.rb @@ -31,18 +31,14 @@ class CGI #:nodoc: # Set multipart to false by default. @multipart = false - # POST and PUT may have params in entity body. If content type is - # missing for POST, assume urlencoded. If content type is missing - # for PUT, don't assume anything and don't parse the parameters: - # it's likely binary data. - # - # The other HTTP methods have their params in the query string. + # POST and PUT may have params in entity body. If content type is missing + # or non-urlencoded, don't read the body or parse parameters: assume it's + # binary data. if method == :post || method == :put if boundary = extract_multipart_form_boundary(content_type) @multipart = true @params = read_multipart(boundary, content_length) elsif content_type.blank? || content_type !~ %r{application/x-www-form-urlencoded}i - read_params(method, content_length) @params = {} end end -- cgit v1.2.3