kraih/mojo — pull request #564 by andrewgregory (2013-11-13 17:53:44+00:00)
Title: Request.pm: use $env->{HTTPS} = 'on' to detect SSL

The standard method to check for https is to check the environment for
$ENV{HTTPS} eq 'on' ('1' is also used for some environments). Although
most servers simply leave $ENV{HTTPS} empty when not using SSL, IIS, at
least, sets it to 'off', breaking the simple boolean check.

IIS documentation:
http://msdn.microsoft.com/en-us/library/ms524602%28v=vs.90%29.aspx

IBM documents similar behavior:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.ihs.doc/ihs/rihs_sslhandshakeenvvar.html

Compatible implementations by other frameworks:
http://www.python.org/dev/peps/pep-0333/#the-server-gateway-side
https://metacpan.org/source/MIYAGAWA/Plack-1.0029/lib/Plack/Handler/CGI.pm#L94
https://metacpan.org/source/MARKSTOS/CGI.pm-3.63/lib/CGI.pm#L3332