1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

If no content is returned, Rack throws an error:

/Users/matt/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/lint.rb: in assert, line 19
/Users/matt/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/lint.rb: in check_content_type
This commit is contained in:
Matthew Ford 2012-04-17 02:05:27 +02:00
parent 93adb17437
commit 38ac842886

View file

@ -21,7 +21,7 @@ module Sidekiq
def call(env)
# Solve the problem of people requesting /sidekiq when they need to request /sidekiq/ so
# that relative links in templates resolve correctly.
return [301, { 'Location' => "#{env['SCRIPT_NAME']}/" }, []] if env['SCRIPT_NAME'] == env['REQUEST_PATH']
return [301, { 'Location' => "#{env['SCRIPT_NAME']}/" }, ['redirecting']] if env['SCRIPT_NAME'] == env['REQUEST_PATH']
return @app.call(env) unless @matcher =~ env["PATH_INFO"]
env['PATH_INFO'].sub!(@matcher,'')