Small improvements (#918)
* Typo fix * No need to use thread-safe object * Use String case in-sensitive equals
This commit is contained in:
parent
6d3f38e2df
commit
dea4a9d2a9
@ -34,10 +34,10 @@ public class HttpBasicsLesson extends AssignmentEndpoint {
|
|||||||
@PostMapping("/HttpBasics/attack1")
|
@PostMapping("/HttpBasics/attack1")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AttackResult completed(@RequestParam String person) {
|
public AttackResult completed(@RequestParam String person) {
|
||||||
if (!person.equals("")) {
|
if (!person.isBlank()) {
|
||||||
return success(this)
|
return success(this)
|
||||||
.feedback("http-basics.reversed")
|
.feedback("http-basics.reversed")
|
||||||
.feedbackArgs(new StringBuffer(person).reverse().toString())
|
.feedbackArgs(new StringBuilder(person).reverse().toString())
|
||||||
.build();
|
.build();
|
||||||
} else {
|
} else {
|
||||||
return failed(this).feedback("http-basics.empty").build();
|
return failed(this).feedback("http-basics.empty").build();
|
||||||
|
@ -38,11 +38,11 @@ public class HttpBasicsQuiz extends AssignmentEndpoint {
|
|||||||
|
|
||||||
@PostMapping("/HttpBasics/attack2")
|
@PostMapping("/HttpBasics/attack2")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AttackResult completed(@RequestParam String answer, @RequestParam String magic_answer, @RequestParam String magic_num) throws IOException {
|
public AttackResult completed(@RequestParam String answer, @RequestParam String magic_answer, @RequestParam String magic_num) {
|
||||||
if ("POST".equals(answer.toUpperCase()) && magic_answer.equals(magic_num)) {
|
if ("POST".equalsIgnoreCase(answer) && magic_answer.equals(magic_num)) {
|
||||||
return success(this).build();
|
return success(this).build();
|
||||||
} else {
|
} else {
|
||||||
if (!"POST".equals(answer.toUpperCase())) {
|
if (!"POST".equalsIgnoreCase(answer)) {
|
||||||
return failed(this).feedback("http-basics.incorrect").build();
|
return failed(this).feedback("http-basics.incorrect").build();
|
||||||
}
|
}
|
||||||
if (!magic_answer.equals(magic_num)) {
|
if (!magic_answer.equals(magic_num)) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
== Introducing WebWolf
|
== Introducing WebWolf
|
||||||
|
|
||||||
You only need WebWolf if a lesson specifies you can use it. For a lot of lessons you use WebGoat without
|
You only need WebWolf if a lesson specifies you can use it. For a lot of lessons you use WebGoat without
|
||||||
starting WebWolf. If you need to do an exercise with WebWolf make sure it is running along side WebGoat. Lessons
|
starting WebWolf. If you need to do an exercise with WebWolf make sure it is running alongside WebGoat. Lessons
|
||||||
where you can use WebWolf are marked with the following icon (top right in assignment):
|
where you can use WebWolf are marked with the following icon (top right in assignment):
|
||||||
|
|
||||||
{nbsp}
|
{nbsp}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user