From 4612a1eea1313c911fa0529927359f3678807213 Mon Sep 17 00:00:00 2001 From: Tomoki Tsubaki Date: Wed, 16 Sep 2020 22:11:36 +0900 Subject: [PATCH] Fix broken Mono chain This commit restore broken Mono chain in WebSessionServerCsrfTokenRepository.generateToken(ServerWebExchange). Closes gh-9017 --- .../web/server/csrf/WebSessionServerCsrfTokenRepository.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/main/java/org/springframework/security/web/server/csrf/WebSessionServerCsrfTokenRepository.java b/web/src/main/java/org/springframework/security/web/server/csrf/WebSessionServerCsrfTokenRepository.java index 9a4714f58a0..e2a9a81adaf 100644 --- a/web/src/main/java/org/springframework/security/web/server/csrf/WebSessionServerCsrfTokenRepository.java +++ b/web/src/main/java/org/springframework/security/web/server/csrf/WebSessionServerCsrfTokenRepository.java @@ -52,8 +52,7 @@ public class WebSessionServerCsrfTokenRepository implements ServerCsrfTokenRepos @Override public Mono generateToken(ServerWebExchange exchange) { - Mono.just(exchange).publishOn(Schedulers.boundedElastic()); - return Mono.fromCallable(() -> createCsrfToken()); + return Mono.fromCallable(() -> createCsrfToken()).subscribeOn(Schedulers.boundedElastic()); } @Override