Skip to content

ForwardedHeaderFilter does not respect Servlet forwarding [SPR-16983] #21521

Closed
@spring-projects-issues

Description

@spring-projects-issues

Eric Sirianni opened SPR-16983 and commented

ForwardedHeaderFilter captures the requestUri on initial request (e.g. /foo).  That request URI can be altered due to a server-side forward - for example:

request.getRequestDispatcher("/bar").forward(request, response)

When the request is re-dispatched, code calling HttpServletRequest.getRequestURI() receives the old value (e.g. /foo) instead of the new value (e.g. /bar). Even if the filter is registered with DispatcherType.FORWARD, the issue remains that the filter implements OncePerRequestFilter.


Affects: 5.0.7

Issue Links:

Referenced from: commits feeec34

2 votes, 4 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions