-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
server.tomcat.use-relative-redirects=true not honored when server.forward-headers-strategy=framework #29333
Conversation
Thanks for the proposal, @terminux, but I think it may be a little too broad. I believe we should only configure the filter to use relative redirects when Tomcat's in use and it has been configured to use relative redirects. If another container's in use or Tomcat's using absolute redirects, the filter's configuration should be unchanged. Unfortunately, I haven't had time to verify that what I believe is required actually is required or to think about how best to implement it. If you have time to do so, that'd be great. Please don't worry if you don't though and thanks again for your efforts thus far. |
Thank you very much for your reply @wilkinsona , nice suggestions. I will reconsider how to implement it based on your suggestion. |
…omcat does not take effect Fixes spring-projectsgh-27801
server.forward-headers-strategy
is configured as framework
use-relative-redirects
configuration item of tomcat does not take effect
Hi @wilkinsona , my idea is to add a static config class specifically for |
Thanks, @terminux. When initially thinking about this, I had rejected something along these lines as I didn't want the configuration of the The alternative to coupling to I'll flag this for a team meeting so that we can discuss these options and any others that come to mind. |
Thanks @wilkinsona , I originally thought about using I also thought about using the callback interface way, for example: interface ForwardedHeaderFilterCustomizer {
void customize(ForwardedHeaderFilter filter);
} But actually |
use-relative-redirects
configuration item of tomcat does not take effectPreviously, when Tomcat was configured to use relative redirects and the ForwardedHeaderFilter is in use, the filter would ignore the use of the relative redirects. This commit corrects this misalignment by applying Tomcat's use relative redirects setting to the filter, but only when Tomcat is being used as the servlet container. See gh-29333
Thanks very much, @terminux. I went for a customizer callback in the end, but as in implementation detail that isn't part of Boot's public API. |
Fixes gh-27801