From 9e366f045368b458cabf72bfba200083649876c9 Mon Sep 17 00:00:00 2001 From: Vidhyadharan Deivamani Date: Thu, 21 Nov 2019 18:00:09 +0530 Subject: [PATCH] KEYCLOAK-8162 review comment adopted --- .../forms/login/freemarker/model/UrlBean.java | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/model/UrlBean.java b/services/src/main/java/org/keycloak/forms/login/freemarker/model/UrlBean.java index 413b889acc..a9815bff48 100755 --- a/services/src/main/java/org/keycloak/forms/login/freemarker/model/UrlBean.java +++ b/services/src/main/java/org/keycloak/forms/login/freemarker/model/UrlBean.java @@ -94,7 +94,7 @@ public class UrlBean { } public String getResourcesUrl() { - return getHostPortScheme(baseURI)+ getResourcesPath(); + return Urls.themeRoot(baseURI).toString() + "/" + theme.getType().toString().toLowerCase() +"/" + theme.getName(); } public String getOauthAction() { @@ -109,31 +109,4 @@ public class UrlBean { URI uri = Urls.themeRoot(baseURI); return uri.getPath() + "/" + theme.getType().toString().toLowerCase() +"/" + theme.getName(); } - - private String getHostPortScheme(URI baseUri) { - - StringBuilder hostPostScheme = new StringBuilder(""); - String scheme = baseUri.getScheme(); - int port = baseUri.getPort(); - String host = baseUri.getHost(); - - if (scheme == null) { - scheme = "http"; - } - hostPostScheme - .append(scheme) - .append("://"); - - if (host == null) { - host = "localhost"; - } - hostPostScheme.append(host); - - if (port != -1) { - hostPostScheme.append(":") - .append(port); - } - - return hostPostScheme.toString(); - } }