Skip to content

Commit efa90d9

Browse files
author
Allan Sandfeld Jensen
committed
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 <[email protected]>
1 parent 5b84b15 commit efa90d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/api/qwebenginecookiestore.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ bool QWebEngineCookieStorePrivate::canAccessCookies(const QUrl &firstPartyUrl, c
196196
if (!filterCallback)
197197
return true;
198198

199-
bool thirdParty =
199+
// Empty first-party URL indicates a first-party request (see net/base/static_cookie_policy.cc)
200+
bool thirdParty = !firstPartyUrl.isEmpty() &&
200201
!net::registry_controlled_domains::SameDomainOrHost(toGurl(url),
201202
toGurl(firstPartyUrl),
202203
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);

0 commit comments

Comments
 (0)