Rack::Request has an #ssl? method that handles this case. call that rather than reproducing its logic

This commit is contained in:
Daniel Nelson 2012-10-29 13:40:08 -05:00
parent 94772cfbfe
commit d6b17977ec
1 changed files with 1 additions and 1 deletions

View File

@ -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