Ignore json file extensions in IsDomain

This commit is contained in:
2dust 2026-03-01 14:20:05 +08:00
parent 6b4ae5a386
commit d56e896f07

View file

@ -497,6 +497,13 @@ public class Utils
return false;
}
var ext = Path.GetExtension(domain);
if (ext.IsNotEmpty()
&& ext[1..].ToLowerInvariant() is "json" or "txt" or "xml" or "cfg" or "ini" or "log" or "yaml" or "yml" or "toml")
{
return false;
}
return Uri.CheckHostName(domain) == UriHostNameType.Dns;
}