Class: Sidekiq::Web::CsrfProtection

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/web/csrf_protection.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, options = nil) ⇒ CsrfProtection

Returns a new instance of CsrfProtection.



35
36
37
# File 'lib/sidekiq/web/csrf_protection.rb', line 35

def initialize(app, options = nil)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



39
40
41
# File 'lib/sidekiq/web/csrf_protection.rb', line 39

def call(env)
  accept?(env) ? admit(env) : deny(env)
end