2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-01-09 20:20:52 -05:00
|
|
|
# tiny middleware to force https if needed
|
|
|
|
class Discourse::ForceHttpsMiddleware
|
|
|
|
|
2017-07-27 21:20:09 -04:00
|
|
|
def initialize(app, config = {})
|
2014-01-09 20:20:52 -05:00
|
|
|
@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
|