Hi,
Probably it's just me, but in our CAS (4.1.4) logs we have random errors like
I tried to investigate the cause for this and wondered why does the service id on the ticket have the params included or is that on purpose.
I then found this in SimpleWebApplicationServiceImpl.java:
public static SimpleWebApplicationServiceImpl createServiceFrom(
final HttpServletRequest request) {
...
final String serviceToUse;
...
} else if (StringUtils.hasText(service)) {
serviceToUse = service;
final String id = cleanupUrl(serviceToUse);
...
return new SimpleWebApplicationServiceImpl(id, serviceToUse,
: Response.ResponseType.REDIRECT);
}
The cleanupUrl method:
/**
* Cleanup the url. Removes jsession ids and query strings.
*
* @param url the url
* @return sanitized url.
*/
protected static String cleanupUrl(final String url) {
if (url == null) {
return null;
}
final int jsessionPosition = url.indexOf(";jsession");
if (jsessionPosition == -1) {
return url;
}
final int questionMarkPosition = url.indexOf('?');
if (questionMarkPosition < jsessionPosition) {
return url.substring(0, url.indexOf(";jsession"));
}
return url.substring(0, jsessionPosition)
+ url.substring(questionMarkPosition);
}
So it seems that the query parameters are never removed from the URL if there no jsession in it. Is this on purpose? Is it so that if a ticket is requested for service=
http://xxx?yyy=zzz then the validation can not be made against
http://xxx ?
Thanks!
Tom