Class: AAF::SecureHeaders::DisableSecureHeadersForErrorPages
- Inherits:
-
Object
- Object
- AAF::SecureHeaders::DisableSecureHeadersForErrorPages
- Defined in:
- lib/aaf/secure_headers/disable_secure_headers_for_error_pages.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ DisableSecureHeadersForErrorPages
constructor
A new instance of DisableSecureHeadersForErrorPages.
Constructor Details
#initialize(app) ⇒ DisableSecureHeadersForErrorPages
Returns a new instance of DisableSecureHeadersForErrorPages.
6 7 8 |
# File 'lib/aaf/secure_headers/disable_secure_headers_for_error_pages.rb', line 6 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/aaf/secure_headers/disable_secure_headers_for_error_pages.rb', line 10 def call(env) @app.call(env).tap do |(status, _, _)| next if status < 400 request = ActionDispatch::Request.new(env) ::SecureHeaders.opt_out_of_all_protection(request) end end |