mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 09:13:08 -07:00
Raise minimum Qt version to 5.9.0
This commit is contained in:
parent
c109b7a57a
commit
5c63ad3b95
11 changed files with 28 additions and 56 deletions
|
@ -630,19 +630,7 @@ bool WebApplication::validateHostHeader(const QStringList &domains) const
|
|||
}
|
||||
|
||||
// try matching host header with local address
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
|
||||
const bool sameAddr = m_env.localAddress.isEqual(QHostAddress(requestHost));
|
||||
#else
|
||||
const auto equal = [](const Q_IPV6ADDR &l, const Q_IPV6ADDR &r) -> bool
|
||||
{
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
if (l[i] != r[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const bool sameAddr = equal(m_env.localAddress.toIPv6Address(), QHostAddress(requestHost).toIPv6Address());
|
||||
#endif
|
||||
|
||||
if (sameAddr)
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue