diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/cgi_process.rb | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 4d44ca8383..25e5643aa1 100644 --- a/actionpack/CHANGELOG +++ b/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') 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 |