diff --git a/api/src/org/labkey/api/util/URLHelper.java b/api/src/org/labkey/api/util/URLHelper.java index f766917f996..cff34c4d2be 100644 --- a/api/src/org/labkey/api/util/URLHelper.java +++ b/api/src/org/labkey/api/util/URLHelper.java @@ -182,9 +182,10 @@ public static StringBuilder getBaseServer(String scheme, String host, int port) public boolean isLocalUri(ViewContext currentContext) { return getHost() == null - || currentContext == null - || currentContext.getActionURL() == null - || getHost().equalsIgnoreCase(currentContext.getActionURL().getHost()); + || currentContext == null + || currentContext.getActionURL() == null + // Scheme check is here for test SAML redirect, which is to the same host ("localhost") but a different scheme + || (getHost().equalsIgnoreCase(currentContext.getActionURL().getHost()) && getScheme().equalsIgnoreCase(currentContext.getActionURL().getScheme())); } public String getURIString()