mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
Fixed cookie filtering, some cookies have empty domain().
This commit is contained in:
parent
f82eda3bae
commit
88de940dc1
@ -23,6 +23,11 @@
|
||||
|
||||
bool containsDomain(QString string, QString domain)
|
||||
{
|
||||
if (string.isEmpty()) {
|
||||
// Some cookies have empty domain() ... bug?
|
||||
return true;
|
||||
}
|
||||
|
||||
string.prepend(".");
|
||||
if (domain.startsWith("www.")) {
|
||||
domain = domain.mid(4);
|
||||
@ -89,9 +94,9 @@ bool CookieJar::setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_allowCookiesFromDomain && !containsDomain(cookie.domain(), url.host())) {
|
||||
if (m_allowCookiesFromDomain && !containsDomain(url.host(), cookie.domain())) {
|
||||
#ifdef COOKIE_DEBUG
|
||||
qDebug() << "purged for domain mismatch" << cookie;
|
||||
qDebug() << "purged for domain mismatch" << cookie << cookie.domain() << url.host();
|
||||
#endif
|
||||
newList.removeOne(cookie);
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user