Skip to content

Commit a9caac8

Browse files
committed
Mark CsrfTokenRequestAttributeHandler#setCsrfRequestAttributeName as Nullable
Closes: gh-18617 Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
1 parent 20e2ba3 commit a9caac8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

web/src/main/java/org/springframework/security/web/csrf/CsrfTokenRequestAttributeHandler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import jakarta.servlet.http.HttpServletRequest;
2222
import jakarta.servlet.http.HttpServletResponse;
23+
import org.jspecify.annotations.Nullable;
2324
import org.apache.commons.logging.Log;
2425
import org.apache.commons.logging.LogFactory;
2526

@@ -33,12 +34,14 @@
3334
*
3435
* @author Steve Riesenberg
3536
* @author Yoobin Yoon
37+
* @author Andrey Litvitski
3638
* @since 5.8
3739
*/
3840
public class CsrfTokenRequestAttributeHandler implements CsrfTokenRequestHandler {
3941

4042
private static final Log logger = LogFactory.getLog(CsrfTokenRequestAttributeHandler.class);
4143

44+
@Nullable
4245
private String csrfRequestAttributeName = "_csrf";
4346

4447
/**
@@ -49,7 +52,7 @@ public class CsrfTokenRequestAttributeHandler implements CsrfTokenRequestHandler
4952
* @param csrfRequestAttributeName the name of an additional request attribute with
5053
* the value of the CsrfToken. Default is {@link CsrfToken#getParameterName()}
5154
*/
52-
public final void setCsrfRequestAttributeName(String csrfRequestAttributeName) {
55+
public final void setCsrfRequestAttributeName(@Nullable String csrfRequestAttributeName) {
5356
this.csrfRequestAttributeName = csrfRequestAttributeName;
5457
}
5558

0 commit comments

Comments
 (0)