Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location scheme should not always correspond to X-Forwarded-Proto #542

Open
modernptz opened this issue Jul 2, 2020 · 1 comment
Open

Comments

@modernptz
Copy link

modernptz commented Jul 2, 2020

Since 20.5.0

Expected behavior

It should be possible to make redirect from http to https and vice versa.

Actual behavior

Currently all Location headers which contains absolute uri are being rewritten by HttpResponseFilter with x-forwarded-proto value as uri scheme.

request.headerMap.get("x-forwarded-proto") match {

if (fullyQualify) s"${RequestUtils.getScheme(request)}:"

@modernptz modernptz reopened this Jul 2, 2020
@cacoco
Copy link
Contributor

cacoco commented Jul 13, 2020

@modernptz the use of x-forwarded-proto is intentional and is only used if the passed value is different than the returned Location header's current scheme is thus intended to do just what you're asking which is be able to switch from http to https (or vice versa) but always based on the x-forwarded-proto value. That is if you're returning an http scheme but the client's originating protocol was actually https.

Are you asking for a way to ignore the x-forwarded-proto header value to be able to return a scheme that is different than the client's originating protocol?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants