Skip to content

Instantly share code, notes, and snippets.

@pingles
Created May 5, 2011 22:30
Show Gist options
  • Save pingles/958109 to your computer and use it in GitHub Desktop.
Save pingles/958109 to your computer and use it in GitHub Desktop.
if @env['HTTPS'] == 'on'
'https'
elsif @env['HTTP_X_FORWARDED_SSL'] == 'on'
'https'
elsif @env['HTTP_X_FORWARDED_PROTO']
@env['HTTP_X_FORWARDED_PROTO'].split(',')[0]
else
@env["rack.url_scheme"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment