Check X-Forwarded-Proto when behind a proxy to see what the protocol is #1015

Closed
wants to merge 2 commits into
from

2 participants

@andyjones

Hey, here is a tiny change to support check X-Forwarded-Proto when behind a proxy

Both https://metacpan.org/pod/Dancer::Deployment#Using-Nginx and http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#cite_ref-17 suggest this is the correct header to check but the code wasn't checking it

@yanick yanick added a commit that closed this pull request Apr 15, 2014
@yanick yanick Merge branch 'pr/1015' into devel
Fixes #1015
b6821f4
@yanick yanick closed this in b6821f4 Apr 15, 2014
@yanick

Looks good. Thanks!

@yanick yanick reopened this Apr 15, 2014
@yanick

See PerlDancer/Dancer2#566 - the code part can be removed

Andy Jones Remove duplicate check for X-Forwarded-Proto header. PSGI prefixes al…
…l HTTP headers with HTTP_ so it is already being checked
1706f2c
@andyjones

Sorry Yanick, you are absolutely right. I've removed the code

I can use Test::TCP like the referenced Dancer2 tests if that helps? Sorry about that

@yanick

@andyjones No problem. :-)

I've ended up leaving the value, but with a note. Under PSGI, we'll never need that failsafe, but as Dancer::Test doesn't use PSGI (yet), and because Test::TCP can be problematic (there are some cases where there are test failing because of port clashes), leaving that bit in the code is the simplest approach for now.

@yanick yanick closed this Apr 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment