BUGFIX: in some proxy scenarios https was not propergated properly

This commit is contained in:
Sam 2014-01-10 12:20:52 +11:00
parent 20aa8bc224
commit 5242a49c02

View file

@ -0,0 +1,17 @@
# tiny middleware to force https if needed
class Discourse::ForceHttpsMiddleware
def initialize(app, config={})
@app = app
end
def call(env)
env['rack.url_scheme'] = 'https' if SiteSetting.use_https
@app.call(env)
end
end
Rails.configuration.middleware.insert_before MessageBus::Rack::Middleware, Discourse::ForceHttpsMiddleware