Add dummy extra method with return type AttackResult because every assignment needs at least one such mapping (in the challenges case this is optional but since the challenges are an extra thing and this is the only assignment which has no such method adding a dummy method makes sense)

This commit is contained in:
Nanne Baars 2020-04-18 21:05:09 +02:00 committed by Nanne Baars
parent 4f649234a9
commit a5350060e1

View File

@ -2,6 +2,7 @@ package org.owasp.webgoat.challenges.challenge8;
import lombok.extern.slf4j.Slf4j;
import org.owasp.webgoat.assignments.AssignmentEndpoint;
import org.owasp.webgoat.assignments.AttackResult;
import org.owasp.webgoat.challenges.Flag;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@ -59,5 +60,10 @@ public class Assignment8 extends AssignmentEndpoint {
var json = Map.of("average", (int) Math.ceil((double) categories / totalNumberOfVotes));
return ResponseEntity.ok(json);
}
@GetMapping("/challenge/8/notUsed")
public AttackResult notUsed() {
throw new IllegalStateException("Should never be called, challenge specific method");
}
}