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