diff options
author | Mehmet Emin İNAÇ <mehmetemininac@gmail.com> | 2015-05-25 20:07:46 +0300 |
---|---|---|
committer | Mehmet Emin İNAÇ <mehmetemininac@gmail.com> | 2015-05-25 20:07:46 +0300 |
commit | b197a1adc5234bbc72d3b9f198d14caddccc5a03 (patch) | |
tree | 7158d18d23c378c61c5acdf4fe83f48339728c89 /actionpack/lib/action_dispatch | |
parent | 88c883b2f98801089d723aa91e98af802f7364e5 (diff) | |
download | rails-b197a1adc5234bbc72d3b9f198d14caddccc5a03.tar.gz rails-b197a1adc5234bbc72d3b9f198d14caddccc5a03.tar.bz2 rails-b197a1adc5234bbc72d3b9f198d14caddccc5a03.zip |
Use memoization while accessing request headers for minimizing memory usage
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 2 |
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. |