aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/journey/router.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/journey/router.rb')
-rw-r--r--actionpack/lib/action_dispatch/journey/router.rb7
1 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 c0317e3ad2..74fa9ee3a2 100644
--- a/actionpack/lib/action_dispatch/journey/router.rb
+++ b/actionpack/lib/action_dispatch/journey/router.rb
@@ -39,7 +39,7 @@ module ActionDispatch
req.path_parameters = set_params.merge parameters
- status, headers, body = route.app.call(req.env)
+ status, headers, body = route.app.serve(req)
if 'pass' == headers['X-Cascade']
req.script_name = script_name
@@ -99,7 +99,10 @@ module ActionDispatch
routes = filter_routes(req.path_info).concat custom_routes.find_all { |r|
r.path.match(req.path_info)
}
- routes.concat get_routes_as_head(routes)
+
+ if req.env["REQUEST_METHOD"] === "HEAD"
+ routes.concat get_routes_as_head(routes)
+ end
routes.sort_by!(&:precedence).select! { |r| r.matches?(req) }