From d6b17977eca1004a5b0f732c3af19a141ee58160 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Mon, 29 Oct 2012 13:40:08 -0500 Subject: [PATCH] Rack::Request has an #ssl? method that handles this case. call that rather than reproducing its logic --- lib/omniauth/strategy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/omniauth/strategy.rb b/lib/omniauth/strategy.rb index 75857ab..7197f38 100644 --- a/lib/omniauth/strategy.rb +++ b/lib/omniauth/strategy.rb @@ -405,7 +405,7 @@ module OmniAuth uri.path = '' uri.query = nil #sometimes the url is actually showing http inside rails because the other layers (like nginx) have handled the ssl termination. - uri.scheme = 'https' if(request.env['HTTP_X_FORWARDED_PROTO'] == 'https') + uri.scheme = 'https' if request.ssl? uri.to_s end end