int i = url.indexOf("/..");
while (i != -1)
{
if (i == (url.length() - 3) || url.charAt(i + 3) == '/')
{
throw new ProxyException(DOT_DOT_NOT_ALLOWED);
}
i = url.indexOf("/..", i + 1);
}
//Next, check if the URL is exactly the default URL
url = url.toLowerCase();
// In IPv6, update to long form, if required.
url = SettingsReplaceUtil.updateIPv6(url);
if (defaultUrl != null && defaultUrl.toLowerCase().equals(url))
{
return;
}
char[] urlChars = url.toCharArray();
// Next, check that the URL matches a dynamic URL pattern
for (i = 0; i < dynamicUrls.size(); i++)
{
char[] pattern = (char[])dynamicUrls.get(i);
boolean matches = StringUtils.findMatchWithWildcard(urlChars, pattern);
if (matches)
{
if (!authSupplied || destination.allowsDynamicAuthentication())
{
return;
}
else
{
throw new ProxyException(MULTIPLE_DOMAIN_PORT);
}
}
}
ProxyException exception = new ProxyException();
exception.setMessage
(DYNAMIC_NOT_CONFIGURED, new Object[] {originalUrl, destination.getId()});
throw exception;
}