aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2015-05-26 03:36:38 +0930
committerMatthew Draper <matthew@trebex.net>2015-05-26 03:36:38 +0930
commit2d261ba43c4e5e97efe835445595a540c451f542 (patch)
tree7158d18d23c378c61c5acdf4fe83f48339728c89
parent88c883b2f98801089d723aa91e98af802f7364e5 (diff)
parentb197a1adc5234bbc72d3b9f198d14caddccc5a03 (diff)
downloadrails-2d261ba43c4e5e97efe835445595a540c451f542.tar.gz
rails-2d261ba43c4e5e97efe835445595a540c451f542.tar.bz2
rails-2d261ba43c4e5e97efe835445595a540c451f542.zip
Merge pull request #20296 from vngrs/use_memoization_to_minimize_memory_usage
Use memoization while accessing request headers for minimizing memory usage
-rw-r--r--actionpack/lib/action_dispatch/http/request.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index a10bc3e419..0f5c5a8eb1 100644
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -181,7 +181,7 @@ module ActionDispatch
#
# request.headers["Content-Type"] # => "text/plain"
def headers
- Http::Headers.new(@env)
+ @headers ||= Http::Headers.new(@env)
end
# Returns a +String+ with the last requested path including their params.