diff options
author | Tamas Zakor <ztamas@inf.u-szeged.hu> | 2021-02-09 07:25:03 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2021-04-15 19:38:20 +0200 |
commit | b5834447f319a43d1bf143c9d2d96d6fcb6dbea9 (patch) | |
tree | 60667caa239a4b541ab003f3d686a6d55bcf213b /src/core | |
parent | 88564c09bbfa592fab096a7ef4b6db207e4ef90f (diff) |
Fix first party url for cookie filter
Stop using SiteForCookies::RepresentativeUrl() if it is used to provide
first party url because it returns a truncated URL and our API is expected
to return the full url of the first party.
Fixes: QTBUG-90231
Change-Id: I628f7f31bfbeaf3de976ae9af1a8fa6408b661c5
Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/net/cookie_monster_delegate_qt.cpp | 2 | ||||
-rw-r--r-- | src/core/net/proxying_restricted_cookie_manager_qt.cpp | 2 | ||||
-rw-r--r-- | src/core/net/proxying_url_loader_factory_qt.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp index 792d34373..6d72a622b 100644 --- a/src/core/net/cookie_monster_delegate_qt.cpp +++ b/src/core/net/cookie_monster_delegate_qt.cpp @@ -80,7 +80,7 @@ public: void AllowedAccess(const GURL &url, const net::SiteForCookies &site_for_cookies, AllowedAccessCallback callback) override { - bool allow = m_delegate->canGetCookies(toQt(site_for_cookies.RepresentativeUrl()), toQt(url)); + bool allow = m_delegate->canGetCookies(toQt(site_for_cookies.first_party_url()), toQt(url)); std::move(callback).Run(allow); } diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.cpp b/src/core/net/proxying_restricted_cookie_manager_qt.cpp index b0d3787de..f86c0e997 100644 --- a/src/core/net/proxying_restricted_cookie_manager_qt.cpp +++ b/src/core/net/proxying_restricted_cookie_manager_qt.cpp @@ -197,7 +197,7 @@ bool ProxyingRestrictedCookieManagerQt::allowCookies(const GURL &url, const net: { if (!m_profileIoData) return false; - return m_profileIoData->canGetCookies(toQt(site_for_cookies.RepresentativeUrl()), toQt(url)); + return m_profileIoData->canGetCookies(toQt(site_for_cookies.first_party_url()), toQt(url)); } } // namespace QtWebEngineCore diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp index ec107fe70..fe9176f1f 100644 --- a/src/core/net/proxying_url_loader_factory_qt.cpp +++ b/src/core/net/proxying_url_loader_factory_qt.cpp @@ -266,7 +266,7 @@ void InterceptedRequest::Restart() if (!top_document_url.is_empty()) firstPartyUrl = toQt(top_document_url); else - firstPartyUrl = toQt(request_.site_for_cookies.RepresentativeUrl()); // m_topDocumentUrl can be empty for the main-frame. + firstPartyUrl = toQt(request_.site_for_cookies.first_party_url()); // m_topDocumentUrl can be empty for the main-frame. auto info = new QWebEngineUrlRequestInfoPrivate(resourceType, navigationType, originalUrl, firstPartyUrl, initiator, QByteArray::fromStdString(request_.method)); |