Permalink
Browse files

add option to FORCE_HTTPS via rack-ssl-enforcer

  • Loading branch information...
1 parent 567cb33 commit c29eb4de228f63dfd42533adfe674bab5f958bed @obfuscurity committed May 1, 2012
Showing with 5 additions and 0 deletions.
  1. +1 −0 Gemfile
  2. +2 −0 Gemfile.lock
  3. +2 −0 web.rb
View
1 Gemfile
@@ -2,4 +2,5 @@ source "http://rubygems.org"
gem "sinatra"
gem "thin"
+gem "rack-ssl-enforcer"
gem "haml"
View
2 Gemfile.lock
@@ -7,6 +7,7 @@ GEM
rack (1.4.1)
rack-protection (1.2.0)
rack
+ rack-ssl-enforcer (0.2.4)
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
@@ -22,5 +23,6 @@ PLATFORMS
DEPENDENCIES
haml
+ rack-ssl-enforcer
sinatra
thin
View
2 web.rb
@@ -1,4 +1,5 @@
require 'sinatra'
+require 'rack-ssl-enforcer'
require 'haml'
module Tasseo
@@ -7,6 +8,7 @@ class Application < Sinatra::Base
configure do
enable :logging
mime_type :js, 'text/javascript'
+ use Rack::SslEnforcer if ENV['FORCE_HTTPS']
end
helpers do

0 comments on commit c29eb4d

Please sign in to comment.