Play Version (2.5.x / etc)
2.5
API (Scala / Java / Neither / Both)
Scala
Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)
MacOS 10.11.5
JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)
OpenJDK 1.8.x
Expected Behavior
If app is behind multiple reverse proxies, X-Forwarded-Forwill correctly be multiple values but X-Forwarded-Proto might not be (which is actually what is recommended in Django framework as it states reverse proxy to strip out all previous X-Forwarded-Proto and insert single flag.). In this case, where two are of different length and X-Forwarded-Proto is single value, it should use that value for secure flag instead of defaulting to false.
Actual Behavior
secure flag is defaulted to false.
My current setting is using heroku on top of cloudflare. Heroku seems to strip out / don't add to existing X-Forwarded-Proto, which is set by cloudflare in front. So even when we use Full SSL for cloudflare (which mandates ssl connection for both heroku - cloudflare and cloudflare - client), X-Forwarded-Proto is still set to single https value, which fails play parser for secure flag and make it defaulted to to false.
Play Version (2.5.x / etc)
2.5
API (Scala / Java / Neither / Both)
Scala
Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)
MacOS 10.11.5
JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)
OpenJDK 1.8.x
Expected Behavior
If app is behind multiple reverse proxies,
X-Forwarded-Forwill correctly be multiple values butX-Forwarded-Protomight not be (which is actually what is recommended in Django framework as it states reverse proxy to strip out all previousX-Forwarded-Protoand insert single flag.). In this case, where two are of different length andX-Forwarded-Protois single value, it should use that value forsecureflag instead of defaulting tofalse.Actual Behavior
secureflag is defaulted tofalse.My current setting is using heroku on top of cloudflare. Heroku seems to strip out / don't add to existing
X-Forwarded-Proto, which is set by cloudflare in front. So even when we use Full SSL for cloudflare (which mandates ssl connection for both heroku - cloudflare and cloudflare - client),X-Forwarded-Protois still set to singlehttpsvalue, which fails play parser forsecureflag and make it defaulted to tofalse.