discourse/config/initializers/050-force_https.rb

16 lines
280 B
Ruby
Raw Normal View History

# frozen_string_literal: true
# tiny middleware to force https if needed
class Discourse::ForceHttpsMiddleware
2017-07-27 21:20:09 -04:00
def initialize(app, config = {})
@app = app
end
def call(env)
env['rack.url_scheme'] = 'https' if SiteSetting.force_https
@app.call(env)
end
end