BUGFIX: in some proxy scenarios https was not propergated properly
This commit is contained in:
parent
20aa8bc224
commit
5242a49c02
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue