lib/grape/api/instance.rb in grape-1.3.2 vs lib/grape/api/instance.rb in grape-1.3.3

- old
+ new

@@ -203,14 +203,15 @@ route_settings = routes_map[route_key] route_settings[:pattern] = route.pattern route_settings[:requirements] = route.requirements route_settings[:path] = route.origin route_settings[:methods] ||= [] - route_settings[:methods] << route.request_method + if route.request_method == '*' || route_settings[:methods].include?('*') + route_settings[:methods] = Grape::Http::Headers::SUPPORTED_METHODS + else + route_settings[:methods] << route.request_method + end route_settings[:endpoint] = route.app - - # using the :any shorthand produces [nil] for route methods, substitute all manually - route_settings[:methods] = Grape::Http::Headers::SUPPORTED_METHODS if route_settings[:methods].include?('*') end end # The paths we collected are prepared (cf. Path#prepare), so they # contain already versioning information when using path versioning.