refactor: remove usage of RequestMapping
This commit is contained in:
parent
87edc7d1db
commit
d913967ec5
@ -29,8 +29,7 @@ import java.util.Random;
|
|||||||
import org.owasp.webgoat.container.i18n.PluginMessages;
|
import org.owasp.webgoat.container.i18n.PluginMessages;
|
||||||
import org.owasp.webgoat.container.session.UserSessionData;
|
import org.owasp.webgoat.container.session.UserSessionData;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@ -41,10 +40,9 @@ public class CSRFGetFlag {
|
|||||||
@Autowired UserSessionData userSessionData;
|
@Autowired UserSessionData userSessionData;
|
||||||
@Autowired private PluginMessages pluginMessages;
|
@Autowired private PluginMessages pluginMessages;
|
||||||
|
|
||||||
@RequestMapping(
|
@PostMapping(
|
||||||
path = "/csrf/basic-get-flag",
|
path = "/csrf/basic-get-flag",
|
||||||
produces = {"application/json"},
|
produces = {"application/json"})
|
||||||
method = RequestMethod.POST)
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Map<String, Object> invoke(HttpServletRequest req) {
|
public Map<String, Object> invoke(HttpServletRequest req) {
|
||||||
|
|
||||||
|
@ -29,9 +29,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.owasp.webgoat.container.session.WebSession;
|
import org.owasp.webgoat.container.session.WebSession;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
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.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.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
@ -43,7 +42,7 @@ public class Ping {
|
|||||||
|
|
||||||
@Autowired private WebSession webSession;
|
@Autowired private WebSession webSession;
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET)
|
@GetMapping
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String logRequest(
|
public String logRequest(
|
||||||
@RequestHeader("User-Agent") String userAgent, @RequestParam(required = false) String text) {
|
@RequestHeader("User-Agent") String userAgent, @RequestParam(required = false) String text) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user