From fd7fb4cfbcb74fb88b9edfeb625b1d7257b3bca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Zubcevic?= Date: Wed, 2 Oct 2019 14:52:21 +0200 Subject: [PATCH] seems that we forgot about this one in the spring-boot-2 upgrade (#674) --- .../main/java/org/owasp/webgoat/challenges/Flag.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/webgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/Flag.java b/webgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/Flag.java index 6015e8468a..5ba39b6388 100644 --- a/webgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/Flag.java +++ b/webgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/Flag.java @@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; import javax.annotation.PostConstruct; import java.util.Map; @@ -48,7 +49,8 @@ * @since 3/23/17. */ @Slf4j -public class Flag { //extends Endpoint { +@RestController +public class Flag { public static final Map FLAGS = Maps.newHashMap(); @Autowired @@ -69,12 +71,7 @@ public void initFlags() { IntStream.range(1, 10).forEach(i -> FLAGS.put(i, UUID.randomUUID().toString())); } -// @Override -// public String getPath() { -// return "challenge/flag"; -// } - - @RequestMapping(method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) + @RequestMapping(path="/challenge/flag", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public AttackResult postFlag(@RequestParam String flag) { UserTracker userTracker = userTrackerRepository.findByUser(webSession.getUserName());