Skip to content

Commit

Permalink
Small path fix for the dev ui
Browse files Browse the repository at this point in the history
Signed-off-by:Phillip Kruger <[email protected]>
  • Loading branch information
phillip-kruger committed Mar 8, 2021
1 parent 0e2dab5 commit 0abeb60
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class DevConsole implements Handler<RoutingContext> {
DevConsole(Engine engine, String httpRootPath, String frameworkRootPath) {
this.engine = engine;
this.globalData.put("httpRootPath", httpRootPath);
this.globalData.put("frameworkRootPath", frameworkRootPath);
this.globalData.put("frameworkRootPath", cleanFrameworkRootPath(frameworkRootPath));
this.globalData.put("quarkusVersion", Version.getVersion());
this.globalData.put("applicationName", config.getOptionalValue("quarkus.application.name", String.class).orElse(""));
this.globalData.put("applicationVersion",
Expand Down Expand Up @@ -97,6 +97,19 @@ public void handle(RoutingContext ctx) {
}
}

/**
* This removes the last / from the path
*
* @param p the path
* @return the path without the last /
*/
private String cleanFrameworkRootPath(String p) {
if (p != null && !p.isEmpty() && p.endsWith("/")) {
return p.substring(0, p.length() - 1);
}
return p;
}

private String getExtensionName(String namespace) {
Map<String, Object> map = extensions.get(namespace);
if (map == null)
Expand Down

0 comments on commit 0abeb60

Please sign in to comment.