Skip to content

Commit

Permalink
Merge pull request WebGoat#147 from ilatypov/master
Browse files Browse the repository at this point in the history
Tidy up CSRF lessons.
  • Loading branch information
mayhew64 committed Nov 25, 2015
2 parents 8284f08 + ea1d852 commit 511ed91
Show file tree
Hide file tree
Showing 7 changed files with 394 additions and 264 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -626,18 +626,37 @@ protected String getPath() {
/**
* Get the link that can be used to request this screen.
*
* Rendering the link in the browser may result in Javascript sending
* additional requests to perform necessary actions or to obtain data
* relevant to the lesson or the element of the lesson selected by the
* user. Thanks to using the hash mark "#" and Javascript handling the
* clicks, the user will experience less waiting as the pages do not have
* to reload entirely.
*
* @return a {@link java.lang.String} object.
*/
public String getLink() {
StringBuffer link = new StringBuffer();
StringBuffer link = new StringBuffer(getPath());

// mvc update:
link.append(getPath()).append("/");
link.append(getScreenId());
link.append("/");
link.append(getCategory().getRanking());
return link
.append("/").append(getScreenId())
.append("/").append(getCategory().getRanking()).toString();
}

/**
* Get the link to the target servlet.
*
* Unlike getLink() this method does not require rendering the output of
* the request to the link in order to execute the servlet's method with
* conventional HTTP query parameters.
*/
public String getServletLink() {
StringBuffer link = new StringBuffer("attack");

return link.toString();
return link
.append("?Screen=").append(getScreenId())
.append("&menu=").append(getCategory().getRanking()).toString();
}

/**
Expand Down
Loading

0 comments on commit 511ed91

Please sign in to comment.