discourse/config/initializers/050-force_https.rb
2015-12-09 11:48:41 +11:00

14 lines
246 B
Ruby

# 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