Skip to content

Commit

Permalink
fixed possible open redirect in QuestionsController
Browse files Browse the repository at this point in the history
  • Loading branch information
albogdano committed Dec 30, 2021
1 parent ee59dd9 commit 6b9543a
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -273,11 +273,11 @@ public String setSpace(@PathVariable(required = false) String space,
}
}
utils.storeSpaceIdInCookie(space, req, res);
String backTo = req.getParameter("returnto");
String backTo = HttpUtils.getBackToUrl(req);
if (StringUtils.isBlank(backTo)) {
return get(req.getParameter("sortby"), req, model);
} else {
return "redirect:" + (StringUtils.isBlank(backTo) ? QUESTIONSLINK : backTo);
return "redirect:" + backTo;
}
}

Expand Down

0 comments on commit 6b9543a

Please sign in to comment.