mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
14 lines
248 B
Ruby
14 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
|
|
|