https://github.com/spring-projects/spring-security/blob/1648151dd232973bacda2bf624f260251c553982/web/src/main/java/org/springframework/security/web/server/csrf/CsrfWebFilter.java#L123

I'm reading the source code of CsrfWebFilter.java, notice that in function filter(ServerWebExchange exchange, WebFilterChain chain) there is such a transformation: ... flatMap(m -> validateToken(exchange)).flatMap(m -> continueFilterChain(exchange, chain))

The first transformation flatMap(m -> validateToken(exchange)) will return type Mono<Void>, so whether the next transformation flatMap(m -> continueFilterChain(exchange, chain)) will never be executed since the prior operator returns Mono<Void>? I am really confused when scanning this piece of code.Is this part of transformation surplus ? In which kind of circumstances do this transformation shall be executed? Can you help me?

Comment From: sjohnr

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add a minimal sample that reproduces this issue if you feel this is a genuine bug.