diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java b/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java index f18162cba0..3d10dad391 100644 --- a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java +++ b/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java @@ -2,15 +2,14 @@ package com.baeldung.springsecuredsockets.controllers; import org.springframework.security.web.csrf.CsrfToken; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; @Controller public class CsrfTokenController { - @RequestMapping(value = "/csrf", method = RequestMethod.GET) + @GetMapping("/csrf") public @ResponseBody String getCsrfToken(HttpServletRequest request) { CsrfToken csrf = (CsrfToken) request.getAttribute(CsrfToken.class.getName());