From b9c63b0aae7a7f9ddf32e155b11a51bd9c441857 Mon Sep 17 00:00:00 2001 From: Terence Sun Date: Sat, 31 Jan 2015 19:15:42 -0800 Subject: Explicitly ignored wildcard verbs from head_routes In match_head_routes, deleted the routes in which request.request_method was empty (matches all HTTP verbs) when responding to a HEAD request. This prevents catch-all routes (such as Racks) from intercepting the HEAD request. Fixes #18698 --- actionpack/lib/action_dispatch/journey/router.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/lib/action_dispatch/journey/router.rb') diff --git a/actionpack/lib/action_dispatch/journey/router.rb b/actionpack/lib/action_dispatch/journey/router.rb index 2b036796ab..e9df984c86 100644 --- a/actionpack/lib/action_dispatch/journey/router.rb +++ b/actionpack/lib/action_dispatch/journey/router.rb @@ -121,6 +121,7 @@ module ActionDispatch end def match_head_routes(routes, req) + routes.delete_if { |route| route.verb == // } head_routes = match_routes(routes, req) if head_routes.empty? -- cgit v1.2.3