Reject hypergrid visitors with just an IP address as homeURI

This commit is contained in:
lickx
2024-08-02 10:29:50 +02:00
committed by lickx
parent 8f5cc78c74
commit e2fa62623b

View File

@@ -432,6 +432,12 @@ namespace OpenSim.Services.HypergridService
if (m_ForeignAgentsAllowed && IsException(aCircuit, m_ForeignsAllowedExceptions))
allowed = false;
string iponly = @"http\:\/\/\d+\.\d+\.\d+\.\d+\:\d+";
Regex r = new Regex(iponly, RegexOptions.IgnoreCase);
Match m = r.Match(aCircuit.ServiceURLs["HomeURI"].ToString());
if (m_ForeignAgentsAllowed && m.Success)
allowed = false; // HomeURI is an ip address, not a proper hostname
if (!m_ForeignAgentsAllowed && IsException(aCircuit, m_ForeignsDisallowedExceptions))
allowed = true;