mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Better root URL handling for zany web servers, fixes #3207
This commit is contained in:
parent
d7c752844e
commit
959ab0ad49
3 changed files with 5 additions and 4 deletions
|
@ -4,6 +4,7 @@
|
|||
-----------
|
||||
|
||||
- Re-enable eager loading of all code when running non-development Rails 5. [#3203]
|
||||
- Better root URL handling for zany web servers [#3207]
|
||||
|
||||
4.2.4
|
||||
-----------
|
||||
|
|
|
@ -28,10 +28,6 @@ module Sidekiq
|
|||
# nothing, backwards compatibility
|
||||
end
|
||||
|
||||
get "" do
|
||||
redirect(root_path)
|
||||
end
|
||||
|
||||
get "/" do
|
||||
@redis_info = redis_info.select{ |k, v| REDIS_KEYS.include? k }
|
||||
stats_history = Sidekiq::Stats::History.new((params['days'] || 30).to_i)
|
||||
|
|
|
@ -45,6 +45,10 @@ module Sidekiq
|
|||
request_method = env[REQUEST_METHOD]
|
||||
path_info = ::Rack::Utils.unescape env[PATH_INFO]
|
||||
|
||||
# There are servers which send an empty string when requesting the root.
|
||||
# These servers should be ashamed of themselves.
|
||||
path_info = "/" if path_info == ""
|
||||
|
||||
@routes[request_method].each do |route|
|
||||
if params = route.match(request_method, path_info)
|
||||
env[ROUTE_PARAMS] = params
|
||||
|
|
Loading…
Add table
Reference in a new issue