Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^3: PSGI, Plack

by McA (Priest)
on Oct 24, 2012 at 20:28 UTC ( #1000709=note: print w/ replies, xml ) Need Help??

in reply to Re^2: PSGI, Plack
in thread PSGI, Plack


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

  • You want to generate absolute URL in the response to reflect the currently used protocol.
  • You want to set the secure attribute on cookies when you know that the response is sent via https.

Best regards

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

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

    # Instead of # use //

    This will use the same protocol as the origin.

Re^4: PSGI, Plack
by afoken (Prior) 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.


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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000709]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2015-10-08 22:35 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (229 votes), past polls