Skip to content

Commit

Permalink
fixed link to target in reports not absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
albogdano committed Apr 26, 2022
1 parent 62a0e92 commit 18713b6
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -35,6 +35,7 @@
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
Expand Down Expand Up @@ -105,6 +106,9 @@ public void create(HttpServletRequest req, HttpServletResponse res, Model model)
//allow anonymous reports
rep.setAuthorName(utils.getLang(req).get("anonymous"));
}
if (StringUtils.startsWith(rep.getLink(), "/")) {
rep.setLink(CONF.serverUrl() + CONF.serverContextPath() + rep.getLink());
}
rep.create();
model.addAttribute("newreport", rep);
res.setStatus(200);
Expand Down

0 comments on commit 18713b6

Please sign in to comment.