http://www.perlmonks.org?node_id=1000709


in reply to Re^2: PSGI, Plack et.al.
in thread PSGI, Plack et.al.

Hi,

but you should not forget that there are circumstances where you want to know whether requests came via https or http. Just two examples:

Best regards
McA

Replies are listed 'Best First'.
Re^4: PSGI, Plack et.al.
by Corion (Patriarch) on Oct 24, 2012 at 20:36 UTC

    A common? trick to avoid the protocol is a schemaless URL:

    # Instead of https://example.com/foo/bar # use //example.com/foo/bar

    This will use the same protocol as the origin.

Re^4: PSGI, Plack et.al.
by afoken (Chancellor) on Oct 25, 2012 at 05:28 UTC
    there are circumstances where you want to know whether requests came via https or http

    At least the Apache webserver sets up several CGI environment variables, the most obvious one is HTTPS set to on. It also adds a ton of environment variables starting with SSL_ describing many aspects of the SSL connection. The CGI 1.1 RFC 3875 leaves HTTPS unspecified, but allows the Apache behaviour.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re^4: PSGI, Plack et.al.
by Anonymous Monk on Oct 25, 2012 at 02:16 UTC