Class: Decidim::Middleware::StripXForwardedHost

Inherits:
Object
  • Object
show all
Defined in:
lib/decidim/middleware/strip_x_forwarded_host.rb

Instance Method Summary collapse

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