class RemoveHsts::Middleware
This is a RACK middleware that removes HSTS header from the response. Rails automatically adds HSTS header for any SSL request and it couldn't be disabled. But we don't need this header, because in our stack it will be added by nginx.
Public Class Methods
new(app)
click to toggle source
# File lib/remove_hsts/middleware.rb, line 7 def initialize(app) @app = app end
Public Instance Methods
call(env)
click to toggle source
# File lib/remove_hsts/middleware.rb, line 11 def call(env) @app.call(env).tap do |status, headers, body| headers.delete('Strict-Transport-Security'.freeze) end end