KEYCLOAK-3364 Fix for dns that ends with digit
This commit is contained in:
parent
f2f508ac2e
commit
ffce2023c0
1 changed files with 6 additions and 8 deletions
|
@ -18,6 +18,7 @@
|
|||
package org.keycloak.protocol.oidc.utils;
|
||||
|
||||
import org.jboss.logging.Logger;
|
||||
import org.keycloak.common.util.UriUtils;
|
||||
import org.keycloak.models.ClientModel;
|
||||
import org.keycloak.models.Constants;
|
||||
import org.keycloak.models.RealmModel;
|
||||
|
@ -121,15 +122,12 @@ public class RedirectUtils {
|
|||
|
||||
private static String relativeToAbsoluteURI(UriInfo uriInfo, String rootUrl, String relative) {
|
||||
if (rootUrl == null || rootUrl.isEmpty()) {
|
||||
URI baseUri = uriInfo.getBaseUri();
|
||||
String uri = baseUri.getScheme() + "://" + baseUri.getHost();
|
||||
if (baseUri.getPort() != -1) {
|
||||
uri += ":" + baseUri.getPort();
|
||||
}
|
||||
rootUrl = uri;
|
||||
rootUrl = UriUtils.getOrigin(uriInfo.getBaseUri());
|
||||
}
|
||||
relative = rootUrl + relative;
|
||||
return relative;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(rootUrl);
|
||||
sb.append(relative);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private static boolean matchesRedirects(Set<String> validRedirects, String redirect) {
|
||||
|
|
Loading…
Reference in a new issue