mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Add Sidekiq::Web.use
This commit is contained in:
parent
34664e9215
commit
288db953e4
1 changed files with 10 additions and 0 deletions
|
@ -38,6 +38,14 @@ module Sidekiq
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def middlewares
|
||||||
|
@middlewares ||= []
|
||||||
|
end
|
||||||
|
|
||||||
|
def use(*middleware_args, &block)
|
||||||
|
middlewares << [middleware_args, block]
|
||||||
|
end
|
||||||
|
|
||||||
def default_tabs
|
def default_tabs
|
||||||
DEFAULT_TABS
|
DEFAULT_TABS
|
||||||
end
|
end
|
||||||
|
@ -85,6 +93,8 @@ module Sidekiq
|
||||||
use ::Rack::Session::Cookie, secret: secret
|
use ::Rack::Session::Cookie, secret: secret
|
||||||
use ::Rack::Protection, use: :authenticity_token unless ENV['RACK_ENV'] == 'test'
|
use ::Rack::Protection, use: :authenticity_token unless ENV['RACK_ENV'] == 'test'
|
||||||
|
|
||||||
|
Web.middlewares.each {|middleware, block| use *middleware, &block }
|
||||||
|
|
||||||
run WebApplication.new(klass)
|
run WebApplication.new(klass)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue