Browse files

Redirect to https

  • Loading branch information...
1 parent be698bb commit 55995448964a06888600badb60e63b62b2ffcd73 @bgentry bgentry committed Oct 10, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 app.rb
View
7 app.rb
@@ -18,6 +18,13 @@
abort("missing env vars: please set FACEBOOK_APP_ID and FACEBOOK_SECRET with your app credentials")
end
+before do
+ # HTTPS redirect
+ unless request.scheme == 'https'
+ redirect "https://#{request.env['HTTP_HOST']}"
+ end
+end
+
helpers do
def url(path)
base = "#{request.scheme}://#{request.env['HTTP_HOST']}"

0 comments on commit 5599544

Please sign in to comment.