added the check for the "/" to both the proxy retriever and the validators.
This commit is contained in:
Scott Battaglia 2008-05-28 21:15:32 +00:00
parent 74b3d60843
commit a7d06fd666
2 changed files with 6 additions and 4 deletions

View File

@ -99,9 +99,9 @@ public final class Cas20ProxyRetriever implements ProxyRetriever {
private String constructUrl(final String proxyGrantingTicketId,
final String targetService) {
try {
return this.casServerUrl + "proxy" + "?pgt="
+ proxyGrantingTicketId + "&targetService="
+ URLEncoder.encode(targetService, "UTF-8");
return this.casServerUrl + (this.casServerUrl.endsWith("/") ? "" : "/") + "proxy" + "?pgt="
+ proxyGrantingTicketId + "&targetService="
+ URLEncoder.encode(targetService, "UTF-8");
} catch (final UnsupportedEncodingException e) {
throw new RuntimeException(e);
}

View File

@ -102,7 +102,9 @@ public abstract class AbstractUrlBasedTicketValidator implements TicketValidator
int i = 0;
synchronized (buffer) {
buffer.append(this.casServerUrlPrefix);
buffer.append("/");
if (!this.casServerUrlPrefix.endsWith("/")) {
buffer.append("/");
}
buffer.append(suffix);
for (final Iterator iter = urlParameters.entrySet().iterator(); iter.hasNext();) {