diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-05 16:55:03 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-05 16:55:03 -0700 |
commit | df71e48be8b08edf287a0ec855342c89bbb94218 (patch) | |
tree | f8aa7235aff496c7e8b8774c1accb335d72c0863 /railties/lib/rails | |
parent | a7fcb0e50a47d13e042f4fdc83da381d0c8a8825 (diff) | |
download | rails-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 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/engine.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 1dede32dd4..3ec5a949a7 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -519,9 +519,8 @@ module Rails # Define the Rack API for this engine. def call(env) env.merge!(env_config) - if env['SCRIPT_NAME'] - env[routes.env_key] = env['SCRIPT_NAME'].dup - end + req = ActionDispatch::Request.new env + req.engine_script_name = req.script_name app.call(env) end |