When a filter is configured to conditionally forward, and it is configured to handle FORWARD dispatches as well, and it prevents infinite forward loops by either extending OncePerRequestFilter or otherwise using request attributes, this can result in infinite forward loops in WebClient tests using MockMvcWebConnection. This change will restrict the maximum number of forwards in MockMvcWebConnection to 100.

Closes gh-29483

Comment From: manthanb

Hey @sbrannen, I am not sure if you are the right person to reach out to, and I am very sorry if you are not. I was wondering whenever you have some time, if you can take a quick look at this request and see if it fixes the issue of potential infinite loop with MockMvcWebConnection - https://github.com/spring-projects/spring-framework/issues/29483.

Comment From: simonbasle

@manthanb are you still able to work on this? (cf review above)

Comment From: manthanb

Hi @simonbasle Very sorry I missed your last comment. Yes, I will make the changes and commit today.

Comment From: simonbasle

(note: to be backported in 5.3.x, as tracked by gh-29866)