Skip to content

StrictServerWebExchangeFirewall breaks spring-cloud-gateways RemoveRequestHeaderGatewayFilterFactory #16013

Closed
@sandra-markerud

Description

@sandra-markerud

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.

Metadata

Metadata

Assignees

Labels

in: webAn issue in web modules (web, webmvc)status: duplicateA duplicate of another issuetype: bugA general bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions