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();