2014-01-10 12:20:52 +11:00
|
|
|
# tiny middleware to force https if needed
|
|
|
|
|
class Discourse::ForceHttpsMiddleware
|
|
|
|
|
|
2017-07-28 10:20:09 +09:00
|
|
|
def initialize(app, config = {})
|
2014-01-10 12:20:52 +11:00
|
|
|
@app = app
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def call(env)
|
2016-06-27 17:26:43 +08:00
|
|
|
env['rack.url_scheme'] = 'https' if SiteSetting.force_https
|
2014-01-10 12:20:52 +11:00
|
|
|
@app.call(env)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|