private bool IsUriConstrained(String uri, String constraint)
{
String host = ExtractHostFromURL(uri);
// a host
if (!constraint.StartsWith("."))
{
if (Platform.CompareIgnoreCase(host, constraint) == 0)
{
return true;
}
}
// in sub domain or domain
else if (WithinDomain(host, constraint))
{
return true;
}
return false;
}