mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 12:59:56 -07:00
Remove 'loopback address detection' helper function
It is not needed since `QHostAddress::isLoopback()` can do the job. PR #21259.
This commit is contained in:
parent
72feee6fdd
commit
fc82abe7f6
3 changed files with 1 additions and 9 deletions
|
@ -54,13 +54,6 @@ namespace Utils
|
|||
return subnet;
|
||||
}
|
||||
|
||||
bool isLoopbackAddress(const QHostAddress &addr)
|
||||
{
|
||||
return (addr == QHostAddress::LocalHost)
|
||||
|| (addr == QHostAddress::LocalHostIPv6)
|
||||
|| (addr == QHostAddress(u"::ffff:127.0.0.1"_s));
|
||||
}
|
||||
|
||||
bool isIPInSubnets(const QHostAddress &addr, const QList<Subnet> &subnets)
|
||||
{
|
||||
QHostAddress protocolEquivalentAddress;
|
||||
|
|
|
@ -45,7 +45,6 @@ namespace Utils::Net
|
|||
|
||||
bool isValidIP(const QString &ip);
|
||||
std::optional<Subnet> parseSubnet(const QString &subnetStr);
|
||||
bool isLoopbackAddress(const QHostAddress &addr);
|
||||
bool isIPInSubnets(const QHostAddress &addr, const QList<Subnet> &subnets);
|
||||
QString subnetToString(const Subnet &subnet);
|
||||
QHostAddress canonicalIPv6Addr(const QHostAddress &addr);
|
||||
|
|
|
@ -698,7 +698,7 @@ QString WebApplication::generateSid() const
|
|||
|
||||
bool WebApplication::isAuthNeeded()
|
||||
{
|
||||
if (!m_isLocalAuthEnabled && Utils::Net::isLoopbackAddress(m_clientAddress))
|
||||
if (!m_isLocalAuthEnabled && m_clientAddress.isLoopback())
|
||||
return false;
|
||||
if (m_isAuthSubnetWhitelistEnabled && Utils::Net::isIPInSubnets(m_clientAddress, m_authSubnetWhitelist))
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue