aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-23 10:25:26 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-23 10:57:25 -0700
commitaaceca625da4be9e192e3c29a85ff523390c58b6 (patch)
treeb5c0cd1aa7c0e789adee123aa4d3ccff4b7e3587 /actionpack
parent0735f8e6ae4031377fc63c9582b82f50a250167e (diff)
downloadrails-aaceca625da4be9e192e3c29a85ff523390c58b6.tar.gz
rails-aaceca625da4be9e192e3c29a85ff523390c58b6.tar.bz2
rails-aaceca625da4be9e192e3c29a85ff523390c58b6.zip
extract request allocation from the main app serving routine
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/journey/router.rb6
-rw-r--r--actionpack/test/dispatch/routing_test.rb1
2 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/journey/router.rb b/actionpack/lib/action_dispatch/journey/router.rb
index 1632c4490d..d64d0923e9 100644
--- a/actionpack/lib/action_dispatch/journey/router.rb
+++ b/actionpack/lib/action_dispatch/journey/router.rb
@@ -31,9 +31,11 @@ module ActionDispatch
def call(env)
req = request_class.new(env)
-
req.path_info = Utils.normalize_path(req.path_info)
+ serve req
+ end
+ def serve(req)
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
path_info = req.path_info
@@ -46,7 +48,7 @@ module ActionDispatch
req.path_parameters = set_params.merge parameters
- status, headers, body = route.app.call(env)
+ status, headers, body = route.app.call(req.env)
if 'pass' == headers['X-Cascade']
req.script_name = script_name
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index ccc3839212..a427113763 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -3369,6 +3369,7 @@ end
class TestAltApp < ActionDispatch::IntegrationTest
class AltRequest
attr_accessor :path_parameters, :path_info, :script_name
+ attr_reader :env
def initialize(env)
@path_parameters = {}