From f3b6ae5a4da6851114b8ea84f24b5233db76cb9c Mon Sep 17 00:00:00 2001 From: Scott Battaglia Date: Mon, 27 Jun 2011 02:58:51 +0000 Subject: [PATCH] CASC-149 parse the trailing slash on a path. Added a javadoc to explain a bit better, as well as an INFO level message. --- .../java/org/jasig/cas/client/util/AbstractCasFilter.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/AbstractCasFilter.java b/cas-client-core/src/main/java/org/jasig/cas/client/util/AbstractCasFilter.java index 6c452de..9b2da82 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/AbstractCasFilter.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/AbstractCasFilter.java @@ -112,9 +112,16 @@ public abstract class AbstractCasFilter extends AbstractConfigurationFilter { return CommonUtils.constructServiceUrl(request, response, this.service, this.serverName, this.artifactParameterName, this.encodeServiceUrl); } + /** + * Note that trailing slashes should not be used in the serverName. As a convenience for this common misconfiguration, we strip them from the provided + * value. + * + * @param serverName the serverName. If this method is called, this should not be null. This AND service should not be both configured. + */ public final void setServerName(final String serverName) { if (serverName != null && serverName.endsWith("/")) { this.serverName = serverName.substring(0, serverName.length()-1); + log.info(String.format("Eliminated extra slash from serverName [%s]. It is now [%s]", serverName, this.serverName)); } else { this.serverName = serverName; }