Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cache CgiRequest#request_parameters so that multiple calls don't re-p…

…arse multipart data.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4256 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit e1c7b5a7f6dc412f0e523265e47fffe7b77e9724 1 parent 3900b36
@technoweenie technoweenie authored
View
2  actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Cache CgiRequest#request_parameters so that multiple calls don't re-parse multipart data. [Rick]
+
* Diff compared routing options. Allow #assert_recognizes to take a second arg as a hash to specify optional request method [Rick]
assert_recognizes({:controller => 'users', :action => 'index'}, 'users')
View
11 actionpack/lib/action_controller/cgi_process.rb
@@ -64,11 +64,12 @@ def query_parameters
end
def request_parameters
- if ActionController::Base.param_parsers.has_key?(content_type)
- CGIMethods.parse_formatted_request_parameters(content_type, @env['RAW_POST_DATA'])
- else
- CGIMethods.parse_request_parameters(@cgi.params)
- end
+ @request_parameters ||=
+ if ActionController::Base.param_parsers.has_key?(content_type)
+ CGIMethods.parse_formatted_request_parameters(content_type, @env['RAW_POST_DATA'])
+ else
+ CGIMethods.parse_request_parameters(@cgi.params)
+ end
end
def cookies
Please sign in to comment.
Something went wrong with that request. Please try again.