Skip to content

StrictServerWebExchangeFirewall breaks spring-cloud-gateways RemoveRequestHeaderGatewayFilterFactory #16013

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

Closed
sandra-markerud opened this issue Oct 30, 2024 · 2 comments
Assignees
Labels
in: web An issue in web modules (web, webmvc) status: duplicate A duplicate of another issue type: bug A general bug

Comments

@sandra-markerud
Copy link

sandra-markerud commented Oct 30, 2024

Describe the bug
With the update to spring-boot-3.3.5, our spring-cloud-gateway application breaks within the built-in "RemoveRequestHeaderGatewayFilterFactory". The exchange to be mutated is now a "StrictFirewallServerWebExchange". Those headers cannot be deleted anymore. Hence, the application throws an UnsupportedOperationException at org.springframework.http.ReadOnlyHttpHeaders.remove

To Reproduce
Within a spring-cloud-gateway application define a route that has the "RemoveRequestHeaderGatewayFilterFactory" applied. Is has to be secured using spring-security (e.g. oauth).

Expected behavior
No exception anymore but the filter to work again

Sample
https://github.com/sandra-markerud/spring-cloud-gateway-upgrade
The main branch contains a working application. The "RemoveRequestHeaderTest" shows, that everything works prior the upgrade. Additionally, the tooling folder contains a docker dompose file for a keycloak and mockserver and http requests for a live demo.
The spring-boot_3.3.5 branch upgrades the application to spring-boot-3.3.5 and now the tests fails with the mentioned exception.

@sandra-markerud sandra-markerud added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Oct 30, 2024
@sjohnr
Copy link
Contributor

sjohnr commented Oct 30, 2024

Thanks @sandra-markerud. I believe this is a duplicate of gh-15989. See this comment for the workaround in the meantime. Please let me know if I have misunderstood anything.

@sjohnr sjohnr closed this as completed Oct 30, 2024
@sjohnr sjohnr self-assigned this Oct 30, 2024
@sjohnr sjohnr added status: duplicate A duplicate of another issue in: web An issue in web modules (web, webmvc) and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 30, 2024
@sandra-markerud
Copy link
Author

Thanks @sjohnr
The proposed workaround works like a charm as I had indeed the same issue mentioned in the linked issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) status: duplicate A duplicate of another issue type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants