fixes duplicated trailing slash if index path has a menu entry

Sun, 17 May 2020 16:00:13 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 17 May 2020 16:00:13 +0200
changeset 58
8d3047f78190
parent 57
1262b5433644
child 59
c759c60507a2

fixes duplicated trailing slash if index path has a menu entry

src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java file | annotate | diff | comparison | revisions
--- a/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java	Sun May 17 15:24:58 2020 +0200
+++ b/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java	Sun May 17 16:00:13 2020 +0200
@@ -166,8 +166,10 @@
                                 || DataAccessObjects.class.isAssignableFrom(param);
                     }
                     if (paramsInjectible) {
-                        final String requestPath = "/" + mapping.get().requestPath()
-                                + (mapping.get().menuKey().isBlank() ? "" : "/");
+                        String requestPath = "/" + mapping.get().requestPath();
+                        if (!mapping.get().requestPath().isBlank() && !mapping.get().menuKey().isBlank()) {
+                            requestPath += "/";
+                        }
 
                         if (mappings
                                 .computeIfAbsent(mapping.get().method(), k -> new HashMap<>())

mercurial