Class: Decidim::Middleware::StripXForwardedHost
- Inherits:
-
Object
- Object
- Decidim::Middleware::StripXForwardedHost
- Defined in:
- lib/decidim/middleware/strip_x_forwarded_host.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ StripXForwardedHost
constructor
A new instance of StripXForwardedHost.
Constructor Details
#initialize(app) ⇒ StripXForwardedHost
Returns a new instance of StripXForwardedHost.
6 7 8 |
# File 'lib/decidim/middleware/strip_x_forwarded_host.rb', line 6 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 |
# File 'lib/decidim/middleware/strip_x_forwarded_host.rb', line 10 def call(env) env["HTTP_X_FORWARDED_HOST"] = nil unless Decidim.follow_http_x_forwarded_host @app.call(env) end |