Created
August 7, 2010 15:17
-
-
Save danmayer/512887 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#redirect all traffic to https over ssl with Sinatra | |
configure :production do | |
# us a simple before filter to redirect all requests in production to https | |
# before do | |
# unless (@env['HTTP_X_FORWARDED_PROTO'] || @env['rack.url_scheme'])=='https' | |
# redirect "https://#{request.env['HTTP_HOST']}#{request.env["REQUEST_PATH"]}" | |
# end | |
# end | |
#even simpler use rack-ssl-enforcer rack middle ware to do the same thing | |
require 'rack-ssl-enforcer' | |
use Rack::SslEnforcer | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shouldn't it be:
require 'rack/ssl-enforcer'