summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-07-13 12:59:26 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-07-21 10:41:05 +0200
commit9c5608e4e4b600581ed17c0a6b2dc316bb1544d0 (patch)
tree162c4f46c7f87068db9a4e79321e1830ab6d6bc0
parent060c09b23b9ec0376fa7fd687d1f853660410f2a (diff)
Fix mistake from 78-based adaptations
The options only need to allow httponly, it doesn't set it, and we shouldn't even forward canonical cookies that were excluded on creation. Change-Id: Ieec45734938c07a50ac03aa113a02a907bce689f Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r--src/core/net/cookie_monster_delegate_qt.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp
index d2e0b38e2..263973684 100644
--- a/src/core/net/cookie_monster_delegate_qt.cpp
+++ b/src/core/net/cookie_monster_delegate_qt.cpp
@@ -145,9 +145,12 @@ void CookieMonsterDelegateQt::setCookie(quint64 callbackId, const QNetworkCookie
callback = base::BindOnce(&CookieMonsterDelegateQt::SetCookieCallbackOnUIThread, this, callbackId);
net::CanonicalCookie::CookieInclusionStatus inclusion;
auto canonCookie = net::CanonicalCookie::Create(gurl, cookie_line, base::Time::Now(), base::nullopt, &inclusion);
+ if (!inclusion.IsInclude()) {
+ LOG(WARNING) << "QWebEngineCookieStore::setCookie() - Tried to set invalid cookie";
+ return;
+ }
net::CookieOptions options;
- if (!inclusion.HasExclusionReason(net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_HTTP_ONLY))
- options.set_include_httponly();
+ options.set_include_httponly();
m_mojoCookieManager->SetCanonicalCookie(*canonCookie.get(), gurl.scheme(), options, std::move(callback));
}