Open modernptz opened 4 years ago
@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?
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 withx-forwarded-proto
value as uri scheme.https://github.com/twitter/finatra/blob/b6453a4d0b047e965b5d43f319d028739b80d5d3/http/src/main/scala/com/twitter/finatra/http/filters/HttpResponseFilter.scala#L94
https://github.com/twitter/finatra/blob/b6453a4d0b047e965b5d43f319d028739b80d5d3/http/src/main/scala/com/twitter/finatra/http/filters/HttpResponseFilter.scala#L114