2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 09:10:25 +08:00
discourse/config/initializers/050-force_https.rb
2017-07-28 10:20:09 +09:00

13 lines
249 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.force_https
@app.call(env)
end
end