1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

CookieJar: Adapt to changes in QtWebEngine 5.11

This commit is contained in:
David Rosca 2018-03-20 13:43:57 +01:00
parent 738cc1d55f
commit 0a23bc9145
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
2 changed files with 7 additions and 8 deletions

View File

@ -121,7 +121,7 @@ void CookieJar::slotCookieRemoved(const QNetworkCookie &cookie)
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
void CookieJar::cookieFilter(QWebEngineCookieStore::FilterRequest &request) const
bool CookieJar::cookieFilter(const QWebEngineCookieStore::FilterRequest &request) const
{
if (!m_allowCookies) {
bool result = listMatchesDomain(m_whitelist, request.origin.host());
@ -129,8 +129,7 @@ void CookieJar::cookieFilter(QWebEngineCookieStore::FilterRequest &request) cons
#ifdef COOKIE_DEBUG
qDebug() << "not in whitelist" << request.origin;
#endif
request.accepted = false;
return;
return false;
}
}
@ -140,8 +139,7 @@ void CookieJar::cookieFilter(QWebEngineCookieStore::FilterRequest &request) cons
#ifdef COOKIE_DEBUG
qDebug() << "found in blacklist" << request.origin.host();
#endif
request.accepted = false;
return;
return false;
}
}
@ -149,9 +147,10 @@ void CookieJar::cookieFilter(QWebEngineCookieStore::FilterRequest &request) cons
#ifdef COOKIE_DEBUG
qDebug() << "thirdParty" << request.firstPartyUrl << request.origin;
#endif
request.accepted = false;
return;
return false;
}
return true;
}
#endif

View File

@ -55,7 +55,7 @@ private:
void slotCookieRemoved(const QNetworkCookie &cookie);
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
void cookieFilter(QWebEngineCookieStore::FilterRequest &request) const;
bool cookieFilter(const QWebEngineCookieStore::FilterRequest &request) const;
#endif
bool acceptCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &cookieSource) const;