http: update setting of "https" for rack.url_scheme
commitb740269f121167c4f93e3a0e155e05422f6e80ff
authorEric Wong <normalperson@yhbt.net>
Mon, 20 Dec 2010 19:40:57 +0000 (20 19:40 +0000)
committerEric Wong <normalperson@yhbt.net>
Mon, 20 Dec 2010 20:45:29 +0000 (20 20:45 +0000)
tree853bbc2717ed511aab04deb2e86fcb18f51f9ef1
parent7ad59e0c48e12febae2a2fe86b76116c05977c6f
http: update setting of "https" for rack.url_scheme

The first value of X-Forwarded-Proto in rack.url_scheme should
be used as it can be chained.  This header can be set multiple
times via different proxies in the chain, but consider the first
one to be valid.

Additionally, respect X-Forwarded-SSL as it may be passed with
the "on" flag instead of X-Forwarded-Proto.

ref: rack commit 85ca454e6143a3081d90e4546ccad602a4c3ad2e
     and 35bb5ba6746b5d346de9202c004cc926039650c7
ext/unicorn_http/global_variables.h
ext/unicorn_http/unicorn_http.rl
test/unit/test_http_parser.rb