refactor: remove usage of RequestMapping

This commit is contained in:
Nanne Baars 2023-12-06 08:52:23 +01:00 committed by Nanne Baars
parent 87edc7d1db
commit d913967ec5
2 changed files with 5 additions and 8 deletions

View File

@ -29,8 +29,7 @@ import java.util.Random;
import org.owasp.webgoat.container.i18n.PluginMessages;
import org.owasp.webgoat.container.session.UserSessionData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@ -41,10 +40,9 @@ public class CSRFGetFlag {
@Autowired UserSessionData userSessionData;
@Autowired private PluginMessages pluginMessages;
@RequestMapping(
@PostMapping(
path = "/csrf/basic-get-flag",
produces = {"application/json"},
method = RequestMethod.POST)
produces = {"application/json"})
@ResponseBody
public Map<String, Object> invoke(HttpServletRequest req) {

View File

@ -29,9 +29,8 @@ import lombok.extern.slf4j.Slf4j;
import org.owasp.webgoat.container.session.WebSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@ -43,7 +42,7 @@ public class Ping {
@Autowired private WebSession webSession;
@RequestMapping(method = RequestMethod.GET)
@GetMapping
@ResponseBody
public String logRequest(
@RequestHeader("User-Agent") String userAgent, @RequestParam(required = false) String text) {