diff options
author | Harry Marr <harry.marr@gmail.com> | 2015-03-20 18:13:59 +0000 |
---|---|---|
committer | Harry Marr <harry.marr@gmail.com> | 2015-03-20 18:13:59 +0000 |
commit | 34a52c6bce2f97398cef4790e49739ef8f865d11 (patch) | |
tree | e6a49554279e0742f9d65737460bcf7ead6ea743 /actionpack/lib/action_dispatch | |
parent | 5154089c181e9b36753b193bd7ffb141e88232f1 (diff) | |
download | rails-34a52c6bce2f97398cef4790e49739ef8f865d11.tar.gz rails-34a52c6bce2f97398cef4790e49739ef8f865d11.tar.bz2 rails-34a52c6bce2f97398cef4790e49739ef8f865d11.zip |
Respect routing precedence for HEAD requests
Fixes the issue described in #18764 - prevents Rack middleware from
swallowing up HEAD requests that should have been matched by a
higher-precedence `get` route, but still allows Rack middleware to
respond to HEAD requests.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/router.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/journey/router.rb b/actionpack/lib/action_dispatch/journey/router.rb index cc4bd6105d..b84aad8eb6 100644 --- a/actionpack/lib/action_dispatch/journey/router.rb +++ b/actionpack/lib/action_dispatch/journey/router.rb @@ -121,7 +121,8 @@ module ActionDispatch end def match_head_routes(routes, req) - head_routes = match_routes(routes, req) + verb_specific_routes = routes.reject { |route| route.verb == // } + head_routes = match_routes(verb_specific_routes, req) if head_routes.empty? begin |