Skip to content

Request header modifications not visible in tests after upgrade to spring-web 6.2.x #34246

@Foteno

Description

@Foteno

Bug report

This issue affects Spring Framework 6.2.0, which is included in Spring Boot 3.4.0.

Description

After upgrading to Spring Framework 6.2.0, unit tests that verify request header modifications in Gateway filters fail. The headers appear to be modified correctly at runtime, but the modifications are not visible in test assertions using MockServerWebExchange.

Here's a StackOverflow post for this issue: StackOverflow post

Steps to reproduce

I created a minimal test case repository for this: https://github.com/Foteno/gateway-bug

Expected behavior

The test should pass as it did in Spring Framework 6.1.x, with the modified header being visible in the MockServerWebExchange.

Actual behavior

The assertion fails because the header modification is not visible in the MockServerWebExchange during the test.

Environment

  • Spring Framework 6.2.0
  • Spring Boot 3.4.0
  • Spring Cloud Gateway 4.2.0
  • Java 17

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions