aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-08-05 16:55:03 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-08-05 16:55:03 -0700
commitdf71e48be8b08edf287a0ec855342c89bbb94218 (patch)
treef8aa7235aff496c7e8b8774c1accb335d72c0863 /actionpack/lib/action_dispatch
parenta7fcb0e50a47d13e042f4fdc83da381d0c8a8825 (diff)
downloadrails-df71e48be8b08edf287a0ec855342c89bbb94218.tar.gz
rails-df71e48be8b08edf287a0ec855342c89bbb94218.tar.bz2
rails-df71e48be8b08edf287a0ec855342c89bbb94218.zip
allocate a request object to avoid hash allocations
This decouples the `call` method from knowing the SCRIPT_NAME key and offloads decisions about how to access script_name
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/request.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index 6985cec5f5..802e7ce539 100644
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -118,6 +118,10 @@ module ActionDispatch
env[_routes.env_key]
end
+ def engine_script_name=(name) # :nodoc:
+ env[routes.env_key] = name.dup
+ end
+
def request_method=(request_method) #:nodoc:
if check_method(request_method)
@request_method = env["REQUEST_METHOD"] = request_method