mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
remove hard coded regular expression
This commit is contained in:
parent
c3284e2a36
commit
ad311f215d
2 changed files with 5 additions and 1 deletions
|
@ -112,6 +112,10 @@ module ActionDispatch
|
|||
constraints[:ip] || //
|
||||
end
|
||||
|
||||
def requires_matching_verb?
|
||||
constraints[:request_method]
|
||||
end
|
||||
|
||||
def verb
|
||||
constraints[:request_method] || //
|
||||
end
|
||||
|
|
|
@ -120,7 +120,7 @@ module ActionDispatch
|
|||
end
|
||||
|
||||
def match_head_routes(routes, req)
|
||||
verb_specific_routes = routes.reject { |route| route.verb == // }
|
||||
verb_specific_routes = routes.select(&:requires_matching_verb?)
|
||||
head_routes = match_routes(verb_specific_routes, req)
|
||||
|
||||
if head_routes.empty?
|
||||
|
|
Loading…
Reference in a new issue