From dbfac1c448ca2badeb90da4c514d6ad5498b0f0f Mon Sep 17 00:00:00 2001 From: Juraj Oravec Date: Sun, 21 Apr 2024 11:43:47 +0200 Subject: [PATCH] Cookiejar: Properly process default permission Signed-off-by: Juraj Oravec --- src/lib/cookies/cookiejar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/cookies/cookiejar.cpp b/src/lib/cookies/cookiejar.cpp index 07f59e00b..055e649dd 100644 --- a/src/lib/cookies/cookiejar.cpp +++ b/src/lib/cookies/cookiejar.cpp @@ -150,6 +150,9 @@ void CookieJar::slotCookieRemoved(const QNetworkCookie &cookie) bool CookieJar::cookieFilter(const QWebEngineCookieStore::FilterRequest &request) const { auto result = mApp->siteSettingsManager()->getPermission(SiteSettingsManager::poAllowCookies, request.origin); + if (result == SiteSettingsManager::Default) { + result = mApp->siteSettingsManager()->getDefaultPermission(SiteSettingsManager::poAllowCookies); + } if (!m_allowCookies && (result != SiteSettingsManager::Allow)) { #ifdef COOKIE_DEBUG @@ -180,6 +183,9 @@ bool CookieJar::rejectCookie(const QString &domain, const QNetworkCookie &cookie Q_UNUSED(domain) auto result = mApp->siteSettingsManager()->getPermission(SiteSettingsManager::poAllowCookies, cookieDomain); + if (result == SiteSettingsManager::Default) { + result = mApp->siteSettingsManager()->getDefaultPermission(SiteSettingsManager::poAllowCookies); + } if (!m_allowCookies && (result != SiteSettingsManager::Allow)) { #ifdef COOKIE_DEBUG