From 624ddeb047167df08e61729902a2e1f94782140a Mon Sep 17 00:00:00 2001
From: Stian Thorgersen <stian@redhat.com>
Date: Wed, 03 Feb 2016 10:49:43 +0000
Subject: [PATCH] Merge pull request #2162 from stianst/master

---
 src/main/java/org/keycloak/protocol/cas/utils/RedirectUtils.java |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/keycloak/protocol/cas/utils/RedirectUtils.java b/src/main/java/org/keycloak/protocol/cas/utils/RedirectUtils.java
index cf8354d..e564090 100644
--- a/src/main/java/org/keycloak/protocol/cas/utils/RedirectUtils.java
+++ b/src/main/java/org/keycloak/protocol/cas/utils/RedirectUtils.java
@@ -1,10 +1,27 @@
+/*
+ * Copyright 2016 Red Hat, Inc. and/or its affiliates
+ * and other contributors as indicated by the @author tags.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.keycloak.protocol.oidc.utils;
 
-import org.jboss.logging.Logger;
 import org.keycloak.models.ClientModel;
 import org.keycloak.models.Constants;
 import org.keycloak.models.RealmModel;
 import org.keycloak.services.Urls;
+import org.keycloak.services.ServicesLogger;
 
 import javax.ws.rs.core.UriInfo;
 import java.net.URI;
@@ -16,7 +33,7 @@
  */
 public class RedirectUtils {
 
-    private static final Logger logger = Logger.getLogger(RedirectUtils.class);
+    private static final ServicesLogger logger = ServicesLogger.ROOT_LOGGER;
 
     public static String verifyRealmRedirectUri(UriInfo uriInfo, String redirectUri, RealmModel realm) {
         Set<String> validRedirects = getValidateRedirectUris(uriInfo, realm);
@@ -108,7 +125,7 @@
     }
 
     private static String relativeToAbsoluteURI(UriInfo uriInfo, String rootUrl, String relative) {
-        if (rootUrl == null) {
+        if (rootUrl == null || rootUrl.isEmpty()) {
             URI baseUri = uriInfo.getBaseUri();
             String uri = baseUri.getScheme() + "://" + baseUri.getHost();
             if (baseUri.getPort() != -1) {

--
Gitblit v1.10.0