mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-16 18:15:25 +00:00
4443e18909
Make the regex patterns case insensitive for robustness
30 lines
968 B
C#
30 lines
968 B
C#
using System.Text.RegularExpressions;
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Proxy
|
|
{
|
|
static class DnsBlacklist
|
|
{
|
|
const RegexOptions RegexOpts = RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.Compiled;
|
|
|
|
private static readonly Regex[] BlockedHosts = new Regex[]
|
|
{
|
|
new Regex(@"^g(.*)\-lp1\.s\.n\.srv\.nintendo\.net$", RegexOpts),
|
|
new Regex(@"^(.*)\-sb\-api\.accounts\.nintendo\.com$", RegexOpts),
|
|
new Regex(@"^(.*)\-sb\.accounts\.nintendo\.com$", RegexOpts),
|
|
new Regex(@"^accounts\.nintendo\.com$", RegexOpts)
|
|
};
|
|
|
|
public static bool IsHostBlocked(string host)
|
|
{
|
|
foreach (Regex regex in BlockedHosts)
|
|
{
|
|
if (regex.IsMatch(host))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
} |