Skip to content

Commit

Permalink
BUGFIX: in some proxy scenarios https was not propergated properly
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Jan 10, 2014
1 parent 20aa8bc commit 5242a49
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions config/initializers/50-force_https.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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.use_https
@app.call(env)
end

end


Rails.configuration.middleware.insert_before MessageBus::Rack::Middleware, Discourse::ForceHttpsMiddleware

0 comments on commit 5242a49

Please sign in to comment.