summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-10-29 15:54:04 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-10-30 18:23:50 +0000
commitefa90d944170f0a2f98c482825b9809c77e7792c (patch)
tree0ad44f3566d281cbde103b24fc291743d550cc63
parent5b84b15cf610eb7ba2f62cf0f675238531816c30 (diff)
Fix thirdParty setting for first party request
Some first party requests has no site_for_cookies yet, and thus returns an empty string. The logic matches that of StaticCookiePolicy. Change-Id: I10caf978dc410639cd21fc2aa01eb2bf6dc67c1f Fixes: QTBUG-71393 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
-rw-r--r--src/core/api/qwebenginecookiestore.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp
index 9a07c7c7b..fa72265dc 100644
--- a/src/core/api/qwebenginecookiestore.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -196,7 +196,8 @@ bool QWebEngineCookieStorePrivate::canAccessCookies(const QUrl &firstPartyUrl, c
if (!filterCallback)
return true;
- bool thirdParty =
+ // Empty first-party URL indicates a first-party request (see net/base/static_cookie_policy.cc)
+ bool thirdParty = !firstPartyUrl.isEmpty() &&
!net::registry_controlled_domains::SameDomainOrHost(toGurl(url),
toGurl(firstPartyUrl),
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);