lib/sidekiq/web/router.rb in sidekiq-7.3.2 vs lib/sidekiq/web/router.rb in sidekiq-7.3.3

- old
+ new

@@ -37,13 +37,16 @@ def delete(path, &block) route(DELETE, path, &block) end - def route(method, path, &block) + def route(*methods, path, &block) @routes ||= {GET => [], POST => [], PUT => [], PATCH => [], DELETE => [], HEAD => []} - @routes[method] << WebRoute.new(method, path, block) + methods.each do |method| + method = method.to_s.upcase + @routes[method] << WebRoute.new(method, path, block) + end end def match(env) request_method = env[REQUEST_METHOD] path_info = ::Rack::Utils.unescape env[PATH_INFO]