This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/config/initializers/050-force_https.rb
2016-06-29 15:02:43 +08:00

15 lines
248 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