From 45a963a011f3190ac9870d1c82d39ebe91fa39d3 Mon Sep 17 00:00:00 2001 From: Steve Riesenberg Date: Thu, 13 Oct 2022 10:56:30 -0500 Subject: [PATCH] Remove CsrfWebFilter.setTokenFromMultipartDataEnabled Closes gh-12019 --- .../security/web/server/csrf/CsrfWebFilter.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/web/src/main/java/org/springframework/security/web/server/csrf/CsrfWebFilter.java b/web/src/main/java/org/springframework/security/web/server/csrf/CsrfWebFilter.java index c5947ff0dd..ff5cdfa1e5 100644 --- a/web/src/main/java/org/springframework/security/web/server/csrf/CsrfWebFilter.java +++ b/web/src/main/java/org/springframework/security/web/server/csrf/CsrfWebFilter.java @@ -113,23 +113,6 @@ public class CsrfWebFilter implements WebFilter { this.requestHandler = requestHandler; } - /** - * Specifies if the {@code CsrfWebFilter} should try to resolve the actual CSRF token - * from the body of multipart data requests. - * @param tokenFromMultipartDataEnabled true if should read from multipart form body, - * else false. Default is false - * @deprecated Use - * {@link ServerCsrfTokenRequestAttributeHandler#setTokenFromMultipartDataEnabled(boolean)} - * instead - */ - @Deprecated - public void setTokenFromMultipartDataEnabled(boolean tokenFromMultipartDataEnabled) { - if (this.requestHandler instanceof ServerCsrfTokenRequestAttributeHandler) { - ((ServerCsrfTokenRequestAttributeHandler) this.requestHandler) - .setTokenFromMultipartDataEnabled(tokenFromMultipartDataEnabled); - } - } - @Override public Mono filter(ServerWebExchange exchange, WebFilterChain chain) { if (Boolean.TRUE.equals(exchange.getAttribute(SHOULD_NOT_FILTER))) {