diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-04-23 18:18:17 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-04-23 18:18:17 +0000 |
commit | e1c7b5a7f6dc412f0e523265e47fffe7b77e9724 (patch) | |
tree | f47e65fc0a80c9652552d0b3d4902e4af289d6a0 /actionpack/lib/action_controller | |
parent | 3900b36896f4e199eabd768e2df0e7b81c8071ad (diff) | |
download | rails-e1c7b5a7f6dc412f0e523265e47fffe7b77e9724.tar.gz rails-e1c7b5a7f6dc412f0e523265e47fffe7b77e9724.tar.bz2 rails-e1c7b5a7f6dc412f0e523265e47fffe7b77e9724.zip |
Cache CgiRequest#request_parameters so that multiple calls don't re-parse multipart data.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4256 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/cgi_process.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/cgi_process.rb b/actionpack/lib/action_controller/cgi_process.rb index ce8acdf313..09a6000b9f 100644 --- a/actionpack/lib/action_controller/cgi_process.rb +++ b/actionpack/lib/action_controller/cgi_process.rb @@ -64,11 +64,12 @@ module ActionController #:nodoc: 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 |