Skip to content

Commit

Permalink
CORS preflight checks not attributed to the correct application
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=228585
<rdar://problem/81220151>

Reviewed by Alex Christensen.

We use _attributedBundleIdentifier to attribute loads to the correct
application. This parameter is set on each NSURLSession in the per-page
session sets. This patch sets the webPageProxyID for CORS preflight check
in the load parameters so the network data task knows to use the per-page
session set, so the loads get attributed to the right application.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::startPreflight):


Canonical link: https://commits.webkit.org/240065@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
kcheney1 committed Jul 29, 2021
1 parent 0d4cc16 commit 4d68a13
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,20 @@
2021-07-29 Kate Cheney <katherine_cheney@apple.com>

CORS preflight checks not attributed to the correct application
https://bugs.webkit.org/show_bug.cgi?id=228585
<rdar://problem/81220151>

Reviewed by Alex Christensen.

We use _attributedBundleIdentifier to attribute loads to the correct
application. This parameter is set on each NSURLSession in the per-page
session sets. This patch sets the webPageProxyID for CORS preflight check
in the load parameters so the network data task knows to use the per-page
session set, so the loads get attributed to the right application.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::startPreflight):

2021-07-29 Peng Liu <peng.liu6@apple.com>

[macOS Catalina] Some feature preferences have wrong default values
Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp
Expand Up @@ -73,6 +73,8 @@ void NetworkCORSPreflightChecker::startPreflight()
if (m_shouldCaptureExtraNetworkLoadMetrics)
m_loadInformation = NetworkTransactionInformation { NetworkTransactionInformation::Type::Preflight, loadParameters.request, { }, { } };

loadParameters.webPageProxyID = m_parameters.webPageProxyID;

if (auto* networkSession = m_networkProcess->networkSession(m_parameters.sessionID)) {
m_task = NetworkDataTask::create(*networkSession, *this, WTFMove(loadParameters));
m_task->resume();
Expand Down

0 comments on commit 4d68a13

Please sign in to comment.