#271 Reset lesson does not work anymore

This commit is contained in:
Nanne Baars
2016-11-15 10:26:09 +01:00
parent 5babe19f2b
commit 2728158f14
6 changed files with 17 additions and 27 deletions

View File

@ -24,12 +24,14 @@
package org.owasp.webgoat.service;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.owasp.webgoat.lessons.AbstractLesson;
import org.owasp.webgoat.session.UserTracker;
import org.owasp.webgoat.session.WebSession;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
/**
* <p>RestartLessonService class.</p>
@ -39,6 +41,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
*/
@Controller
@AllArgsConstructor
@Slf4j
public class RestartLessonService {
private final WebSession webSession;
@ -50,13 +53,11 @@ public class RestartLessonService {
* @return a {@link java.lang.String} object.
*/
@RequestMapping(path = "/service/restartlesson.mvc", produces = "text/text")
public
@ResponseBody
String restartLesson() {
@ResponseStatus(value = HttpStatus.OK)
public void restartLesson() {
AbstractLesson al = webSession.getCurrentLesson();
System.out.println("Restarting lesson: " + al);
userTracker.getLessonTracker(al).reset();
log.debug("Restarting lesson: " + al);
return webSession.getCurrentLesson().getLink();
userTracker.reset(al);
}
}