From 7868164ad904fcd303deddd8435fb08fc6024bf3 Mon Sep 17 00:00:00 2001 From: John Niang Date: Fri, 26 Jan 2024 17:49:02 +0800 Subject: [PATCH] Fix the problem of resolving logo starting with slash Signed-off-by: John Niang --- .../halo/app/core/extension/reconciler/PluginReconciler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/src/main/java/run/halo/app/core/extension/reconciler/PluginReconciler.java b/application/src/main/java/run/halo/app/core/extension/reconciler/PluginReconciler.java index 8f629886c1..6f0d13967a 100644 --- a/application/src/main/java/run/halo/app/core/extension/reconciler/PluginReconciler.java +++ b/application/src/main/java/run/halo/app/core/extension/reconciler/PluginReconciler.java @@ -240,7 +240,7 @@ private void resolveStaticResources(Plugin plugin) { log.info("Resolving logo resource for plugin {}", pluginName); // the logo might be: // 1. URL - // 2. file name + // 2. relative path to "resources" folder // 3. base64 format data image var logo = specLogo; if (!specLogo.startsWith("data:image")) { @@ -249,7 +249,8 @@ private void resolveStaticResources(Plugin plugin) { } catch (MalformedURLException ignored) { // indicate the logo is a path logo = UriComponentsBuilder.newInstance() - .pathSegment("plugins", pluginName, "assets", specLogo) + .pathSegment("plugins", pluginName, "assets") + .path(specLogo) .queryParam("version", pluginVersion) .build(true) .toString();