1
0
Fork 0
mirror of https://github.com/omniauth/omniauth.git synced 2022-11-09 12:31:49 -05:00

Handle HTTP_X_FORWARDED_PROTO header for https

This commit is contained in:
Behrang Javaherian 2012-02-02 11:21:25 +11:00
parent 7840608a02
commit 1e1e09304d

View file

@ -376,6 +376,8 @@ module OmniAuth
uri = URI.parse(request.url.gsub(/\?.*$/,''))
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.to_s
end
end