From 9f4d4624ac3a96575362204c6f7c0f8a2349c305 Mon Sep 17 00:00:00 2001 From: pnzrr <93841792+pnzrr@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:31:34 -0600 Subject: [PATCH] ensure no leading or trailing whitespace (#45) --- .../keycloak/themes/resource/AssetsResourceProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/phasetwo/keycloak/themes/resource/AssetsResourceProvider.java b/src/main/java/io/phasetwo/keycloak/themes/resource/AssetsResourceProvider.java index d27a395..a071dc9 100644 --- a/src/main/java/io/phasetwo/keycloak/themes/resource/AssetsResourceProvider.java +++ b/src/main/java/io/phasetwo/keycloak/themes/resource/AssetsResourceProvider.java @@ -70,7 +70,8 @@ private Response resourceRedirect(UriInfo uriInfo, String key, String defaultPat "%s/%s/%s", theme.getType().toString().toLowerCase(), theme.getName(), defaultPath)); } else { - redir = new URI(imgUrl); + // ensure no leading or following spaces + redir = new URI(imgUrl.trim()); } log.debugf("redirecting to %s", redir); return Response.seeOther(redir).build();