ForwardedHeaderFilter should support sendRedirect [SPR-15020] #19587
Comments
Swagata Roy commented I was able to get this working by using the attached code. Thanks! |
Rossen Stoyanchev commented Tomcat has a RemoteIpFilter that also seems to only take care of the request. I don't see anything for redirects. |
Rob Winch commented Rossen Stoyanchev It probably should have something for redirects. The Javadoc on sendRedirect states:
Another thing to point out is that many people probably use the RemoteIpValve which rewrites the catalina Request which is used by the catalina Response to sendRedirect. In short, the RemoteIpValve only needs to change the request and this automatically ensures You can see an example of this working in https://github.com/rwinch/boot-forwardedheaderfilter/tree/remoteipvalve You can see how the scheme is overridden You can also see that Jetty supports overriding the values using |
Stefan Pfeiffer commented This change somehow conflicts with |
Rob Winch commented Is `` a typo? You should be using Thanks! |
Swagata Roy commented I have tested, this works for me using 4.3.5. Also, we have set Thanks! |
Stefan Pfeiffer commented
|
Stefan Pfeiffer commented
|
Rob Winch commented Stefan Pfeiffer By default Spring Boot uses built in x-forwarded support which is servlet container specific. The Also keep in mind that these changes will only be seen if you are using Spring 4.3.5 which is not included by default in Spring Boot until 1.4.3. I have put together a small Spring Boot sample with some tests that appear to demonstrate things work properly with Spring Security's If none of the information above helps and you still think there is a problem, please feel free to use the above sample as a starting point for recreating the issue you have. Once you can recreate the issue (or provide us information on how to create it), please create a ticket and reference it here in the comments. |
Stefan Pfeiffer commented I submitted a PR to the base example that shows the behaviour described in #19654 and makes the tests fail. |
Stefan Pfeiffer commented As a side note, the problem is completely unaffected by the |
Swagata Roy opened SPR-15020 and commented
By default, Spring Boot provides an embedded Apache Tomcat build. Unfortunately, Tomcat does not support X-Forwarded-Host.
Here is the redirect code -
These are the results -
This is what I am expecting -
Affects: 4.3.4
Attachments:
Issue Links:
Referenced from: pull request #1270
0 votes, 5 watchers
The text was updated successfully, but these errors were encountered: