Title: [293591] trunk/Source/WebKit
Revision
293591
Author
[email protected]
Date
2022-04-28 15:21:42 -0700 (Thu, 28 Apr 2022)

Log Message

Set top origin of CORS preflight requests
https://bugs.webkit.org/show_bug.cgi?id=239869
<rdar://92458995>

Patch by Alex Christensen <[email protected]> on 2022-04-28
Reviewed by Geoffrey Garen.

Since r293481 we establish two TCP connections to each domain that needs a CORS preflight request.
This is because we were calling _setPrivacyProxyFailClosedForUnreachableNonMainHosts for the CORS
preflight request but not the actual request after a successful CORS preflight check.  They were
different because we weren't setting parameters.topOrigin for the CORS preflight request.  Now we
are and the two requests can share a TCP connection once more.

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

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (293590 => 293591)


--- trunk/Source/WebKit/ChangeLog	2022-04-28 21:46:51 UTC (rev 293590)
+++ trunk/Source/WebKit/ChangeLog	2022-04-28 22:21:42 UTC (rev 293591)
@@ -1,3 +1,20 @@
+2022-04-28  Alex Christensen  <[email protected]>
+
+        Set top origin of CORS preflight requests
+        https://bugs.webkit.org/show_bug.cgi?id=239869
+        <rdar://92458995>
+
+        Reviewed by Geoffrey Garen.
+
+        Since r293481 we establish two TCP connections to each domain that needs a CORS preflight request.
+        This is because we were calling _setPrivacyProxyFailClosedForUnreachableNonMainHosts for the CORS
+        preflight request but not the actual request after a successful CORS preflight check.  They were
+        different because we weren't setting parameters.topOrigin for the CORS preflight request.  Now we
+        are and the two requests can share a TCP connection once more.
+
+        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
+        (WebKit::NetworkCORSPreflightChecker::startPreflight):
+
 2022-04-28  Per Arne Vollan  <[email protected]>
 
         Fix build error after r293509

Modified: trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp (293590 => 293591)


--- trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp	2022-04-28 21:46:51 UTC (rev 293590)
+++ trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp	2022-04-28 22:21:42 UTC (rev 293591)
@@ -75,6 +75,7 @@
         m_loadInformation = NetworkTransactionInformation { NetworkTransactionInformation::Type::Preflight, loadParameters.request, { }, { } };
 
     loadParameters.webPageProxyID = m_parameters.webPageProxyID;
+    loadParameters.topOrigin = m_parameters.topOrigin;
 
     if (auto* networkSession = m_networkProcess->networkSession(m_parameters.sessionID)) {
         m_task = NetworkDataTask::create(*networkSession, *this, WTFMove(loadParameters));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to