mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-02 11:59:17 -05:00
BUGFIX: in some proxy scenarios https was not propergated properly
This commit is contained in:
parent
20aa8bc224
commit
5242a49c02
1 changed files with 17 additions and 0 deletions
17
config/initializers/50-force_https.rb
Normal file
17
config/initializers/50-force_https.rb
Normal 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
|
||||||
|
|
Loading…
Reference in a new issue