Skip to content

Commit eada5a5

Browse files
committed
Redirect to url with trailing slash
1 parent 9937ac2 commit eada5a5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/eu/openanalytics/shinyproxy/controllers/IndexController.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,19 @@ public void init() {
6969
landingPage = environment.getProperty("proxy.landing-page", "/");
7070
}
7171

72-
@RequestMapping("/")
72+
@RequestMapping(path={"", "/"})
7373
private Object index(ModelMap map, HttpServletRequest request) {
7474
if (!landingPage.equals(PROXY_LANDING_PAGE_INDEX_OPTION)
7575
&& !landingPage.equals(PROXY_LANDING_PAGE_SINGLE_APP_OPTION)
7676
&& !landingPage.equals(PROXY_LANDING_PAGE_FIRST_APP_OPTION)) {
7777
return new RedirectView(landingPage, true);
7878
}
7979

80+
if (request.getServletPath().equals("")) {
81+
// ensure URL has trailing slash
82+
return new RedirectView("/", true);
83+
}
84+
8085
List<ProxySpec> apps = proxyService.getUserSpecs();
8186

8287
// If set to `FirstApp`, redirect to the first app available to the logged-in user

0 commit comments

Comments
 (0)