How comprehensive is this malicious URL test?
public static bool IsUrlDomainValid(this Uri uri, List<string> whitelist)
return whitelist.Any(w => uri.Host.EndsWith(w));
I create a while list that contains various good domains:
and want this function to fail if there is a single domain that is not whitelisted.
Is that was this code does? I get worried with the use of "endswith"
What if the last domain is a good one, but there is a bad one in the middle?