Class: Gitlab::Middleware::SidekiqWebStatic

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/middleware/sidekiq_web_static.rb

Constant Summary collapse

SIDEKIQ_REGEX =
%r{\A/admin/sidekiq/}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ SidekiqWebStatic

Returns a new instance of SidekiqWebStatic.


13
14
15
# File 'lib/gitlab/middleware/sidekiq_web_static.rb', line 13

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object


17
18
19
20
21
# File 'lib/gitlab/middleware/sidekiq_web_static.rb', line 17

def call(env)
  env.delete('HTTP_X_SENDFILE_TYPE') if env['PATH_INFO'] =~ SIDEKIQ_REGEX

  @app.call(env)
end