diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-01-04 12:15:15 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-01-04 12:15:15 -0600 |
commit | f00e86d7e9c7a4689a49fc085bcb757c5a2c0b03 (patch) | |
tree | 0acd5b9b645d658dcf2ceaced995df5b1483188c /actionpack/lib/action_controller/request_parser.rb | |
parent | ed2e776bdec3f0764433a6dc4f592f9bebfea859 (diff) | |
download | rails-f00e86d7e9c7a4689a49fc085bcb757c5a2c0b03.tar.gz rails-f00e86d7e9c7a4689a49fc085bcb757c5a2c0b03.tar.bz2 rails-f00e86d7e9c7a4689a49fc085bcb757c5a2c0b03.zip |
Memoize request accessors on the Rack env so other request objects have access to the same cache [#1668 state:resolved]
Diffstat (limited to 'actionpack/lib/action_controller/request_parser.rb')
-rw-r--r-- | actionpack/lib/action_controller/request_parser.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/request_parser.rb b/actionpack/lib/action_controller/request_parser.rb index 82ee4c84c4..20d53f5d92 100644 --- a/actionpack/lib/action_controller/request_parser.rb +++ b/actionpack/lib/action_controller/request_parser.rb @@ -2,14 +2,15 @@ module ActionController class RequestParser def initialize(env) @env = env + freeze end def request_parameters - @request_parameters ||= parse_formatted_request_parameters + @env["action_controller.request_parser.request_parameters"] ||= parse_formatted_request_parameters end def query_parameters - @query_parameters ||= self.class.parse_query_parameters(query_string) + @env["action_controller.request_parser.query_parameters"] ||= self.class.parse_query_parameters(query_string) end # Returns the query string, accounting for server idiosyncrasies. @@ -90,7 +91,7 @@ module ActionController end def content_length - @content_length ||= @env['CONTENT_LENGTH'].to_i + @env["action_controller.request.content_length"] ||= @env['CONTENT_LENGTH'].to_i end # The raw content type string. Use when you need parameters such as |