Skip to content
Snippets Groups Projects
Unverified Commit dea4a9d2 authored by avivmu's avatar avivmu Committed by GitHub
Browse files

Small improvements (#918)

* Typo fix

* No need to use thread-safe object

* Use String case in-sensitive equals
parent 6d3f38e2
No related branches found
No related tags found
No related merge requests found
......@@ -34,10 +34,10 @@ public class HttpBasicsLesson extends AssignmentEndpoint {
@PostMapping("/HttpBasics/attack1")
@ResponseBody
public AttackResult completed(@RequestParam String person) {
if (!person.equals("")) {
if (!person.isBlank()) {
return success(this)
.feedback("http-basics.reversed")
.feedbackArgs(new StringBuffer(person).reverse().toString())
.feedbackArgs(new StringBuilder(person).reverse().toString())
.build();
} else {
return failed(this).feedback("http-basics.empty").build();
......
......@@ -38,11 +38,11 @@ public class HttpBasicsQuiz extends AssignmentEndpoint {
@PostMapping("/HttpBasics/attack2")
@ResponseBody
public AttackResult completed(@RequestParam String answer, @RequestParam String magic_answer, @RequestParam String magic_num) throws IOException {
if ("POST".equals(answer.toUpperCase()) && magic_answer.equals(magic_num)) {
public AttackResult completed(@RequestParam String answer, @RequestParam String magic_answer, @RequestParam String magic_num) {
if ("POST".equalsIgnoreCase(answer) && magic_answer.equals(magic_num)) {
return success(this).build();
} else {
if (!"POST".equals(answer.toUpperCase())) {
if (!"POST".equalsIgnoreCase(answer)) {
return failed(this).feedback("http-basics.incorrect").build();
}
if (!magic_answer.equals(magic_num)) {
......
== Introducing WebWolf
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):
{nbsp}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment