Skip to content

Instantly share code, notes, and snippets.

@sandosh
sandosh / rack.rb
Created February 18, 2011 21:15 — forked from mironov/rack.rb
module Rack
class Request
def scheme
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