<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[224698] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/224698">224698</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2017-11-10 11:06:50 -0800 (Fri, 10 Nov 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Ignore HSTS for partitioned, cross-origin subresource requests
https://bugs.webkit.org/show_bug.cgi?id=178993
<rdar://problem/34962462>

Patch by John Wilander <wilander@apple.com> on 2017-11-10
Reviewed by Brent Fulgham.

Source/WebCore:

No new tests. HSTS is not supported in layout tests.
Tested manually.

* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::synthesizeRedirectResponseIfNecessary):

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
    Added
    - (BOOL)_schemeWasUpgradedDueToDynamicHSTS
    - (BOOL)_preventHSTSStorage
    - (BOOL)_ignoreHSTS
    - (void)_setPreventHSTSStorage:(BOOL)preventHSTSStorage
    - (void)_setIgnoreHSTS:(BOOL)ignoreHSTS

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(downgradeRequest):
    Convenience function to downgrade a request if
    CFNetwork as already upgraded it during
    canonicalization. This allows the rest of 
    WebKit's processing to function, such as UIR
    and mixed content blocking.
(updateIgnoreStrictTransportSecuritySettingIfNecessary):
    Adds and removed the ignore request accordingly.
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
    Now asks CFNetwork to ignore HSTS on resource loads we
    partition cookies for.
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
    Now asks CFNetwork to ignore HSTS on resource loads we
    partition cookies for.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePALChangeLog">trunk/Source/WebCore/PAL/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePALpalspicfCFNetworkSPIh">trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacWebCoreURLResponsemm">trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscocoaNetworkSessionCocoamm">trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (224697 => 224698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-11-10 19:01:39 UTC (rev 224697)
+++ trunk/Source/WebCore/ChangeLog      2017-11-10 19:06:50 UTC (rev 224698)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2017-11-10  John Wilander  <wilander@apple.com>
+
+        Ignore HSTS for partitioned, cross-origin subresource requests
+        https://bugs.webkit.org/show_bug.cgi?id=178993
+        <rdar://problem/34962462>
+
+        Reviewed by Brent Fulgham.
+
+        No new tests. HSTS is not supported in layout tests.
+        Tested manually.
+
+        * platform/network/mac/WebCoreURLResponse.mm:
+        (WebCore::synthesizeRedirectResponseIfNecessary):
+
</ins><span class="cx"> 2017-11-10  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r224267): WebViews scheduled with custom run loop modes don't load
</span></span></pre></div>
<a id="trunkSourceWebCorePALChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/ChangeLog (224697 => 224698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/ChangeLog       2017-11-10 19:01:39 UTC (rev 224697)
+++ trunk/Source/WebCore/PAL/ChangeLog  2017-11-10 19:06:50 UTC (rev 224698)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2017-11-10  John Wilander  <wilander@apple.com>
+
+        Ignore HSTS for partitioned, cross-origin subresource requests
+        https://bugs.webkit.org/show_bug.cgi?id=178993
+        <rdar://problem/34962462>
+
+        Reviewed by Brent Fulgham.
+
+        * pal/spi/cf/CFNetworkSPI.h:
+            Added
+            - (BOOL)_schemeWasUpgradedDueToDynamicHSTS
+            - (BOOL)_preventHSTSStorage
+            - (BOOL)_ignoreHSTS
+            - (void)_setPreventHSTSStorage:(BOOL)preventHSTSStorage
+            - (void)_setIgnoreHSTS:(BOOL)ignoreHSTS
+
+
</ins><span class="cx"> 2017-11-09  Dan Bernstein  <mitz@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [Xcode] An extra copy of FileSizeFormatter.h is installed in /usr/local/include
</span></span></pre></div>
<a id="trunkSourceWebCorePALpalspicfCFNetworkSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h (224697 => 224698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h       2017-11-10 19:01:39 UTC (rev 224697)
+++ trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h  2017-11-10 19:06:50 UTC (rev 224698)
</span><span class="lines">@@ -30,6 +30,18 @@
</span><span class="cx"> #include <CFNetwork/CFNetwork.h>
</span><span class="cx"> #include <pal/spi/cf/CFNetworkConnectionCacheSPI.h>
</span><span class="cx"> 
</span><ins>+#if ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101302 && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110200) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 40200) || (PLATFORM(TVOS) && __TV_OS_VERSION_MIN_REQUIRED >= 110200))
+#define USE_CFNETWORK_IGNORE_HSTS 1
+
+/* FIXME: Remove after rdar 35390452 is fixed: */
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
+#undef USE_CFNETWORK_IGNORE_HSTS
+#define USE_CFNETWORK_IGNORE_HSTS 0
+#endif
+
+#endif
+
+
</ins><span class="cx"> #if PLATFORM(WIN) || USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> 
</span><span class="cx"> #include <CFNetwork/CFHTTPCookiesPriv.h>
</span><span class="lines">@@ -97,11 +109,20 @@
</span><span class="cx"> - (id)_initWithCFURLRequest:(CFURLRequestRef)request;
</span><span class="cx"> - (id)_propertyForKey:(NSString *)key;
</span><span class="cx"> - (void)_setProperty:(id)value forKey:(NSString *)key;
</span><ins>+#if USE(CFNETWORK_IGNORE_HSTS)
+- (BOOL)_schemeWasUpgradedDueToDynamicHSTS;
+- (BOOL)_preventHSTSStorage;
+- (BOOL)_ignoreHSTS;
+#endif
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface NSMutableURLRequest ()
</span><span class="cx"> - (void)setContentDispositionEncodingFallbackArray:(NSArray *)theEncodingFallbackArray;
</span><span class="cx"> - (void)setBoundInterfaceIdentifier:(NSString *)identifier;
</span><ins>+#if USE(CFNETWORK_IGNORE_HSTS)
+- (void)_setPreventHSTSStorage:(BOOL)preventHSTSStorage;
+- (void)_setIgnoreHSTS:(BOOL)ignoreHSTS;
+#endif
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface NSURLResponse ()
</span><span class="lines">@@ -324,4 +345,24 @@
</span><span class="cx"> - (void)_setMIMEType:(NSString *)type;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+static bool schemeWasUpgradedDueToDynamicHSTS(NSURLRequest *request)
+{
+    if ([request respondsToSelector:@selector(_schemeWasUpgradedDueToDynamicHSTS)])
+        return [request performSelector:@selector(_schemeWasUpgradedDueToDynamicHSTS)];
+    return false;
+}
+
+static void setIgnoreHSTS(NSMutableURLRequest *request, bool ignoreHSTS)
+{
+    if ([request respondsToSelector:@selector(_setIgnoreHSTS)])
+        [request performSelector:@selector(_setIgnoreHSTS) withObject:[NSNumber numberWithBool:ignoreHSTS]];
+}
+
+static bool ignoreHSTS(NSURLRequest *request)
+{
+    if ([request respondsToSelector:@selector(_ignoreHSTS)])
+        return [request performSelector:@selector(_ignoreHSTS)];
+    return false;
+}
+
</ins><span class="cx"> #endif // defined(__OBJC__)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacWebCoreURLResponsemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm (224697 => 224698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm  2017-11-10 19:01:39 UTC (rev 224697)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm     2017-11-10 19:06:50 UTC (rev 224698)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> #import "MIMETypeRegistry.h"
</span><span class="cx"> #import "UTIUtilities.h"
</span><ins>+#import <pal/spi/cf/CFNetworkSPI.h>
</ins><span class="cx"> #import <wtf/Assertions.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx"> 
</span><span class="lines">@@ -332,7 +333,7 @@
</span><span class="cx">     if (redirectResponse)
</span><span class="cx">         return redirectResponse;
</span><span class="cx"> 
</span><del>-    if ([[[newRequest URL] scheme] isEqualToString:[[currentRequest URL] scheme]])
</del><ins>+    if ([[[newRequest URL] scheme] isEqualToString:[[currentRequest URL] scheme]] && !schemeWasUpgradedDueToDynamicHSTS(newRequest))
</ins><span class="cx">         return nil;
</span><span class="cx"> 
</span><span class="cx">     // If the new request is a different protocol than the current request, synthesize a redirect response.
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (224697 => 224698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2017-11-10 19:01:39 UTC (rev 224697)
+++ trunk/Source/WebKit/ChangeLog       2017-11-10 19:06:50 UTC (rev 224698)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2017-11-10  John Wilander  <wilander@apple.com>
+
+        Ignore HSTS for partitioned, cross-origin subresource requests
+        https://bugs.webkit.org/show_bug.cgi?id=178993
+        <rdar://problem/34962462>
+
+        Reviewed by Brent Fulgham.
+
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (downgradeRequest):
+            Convenience function to downgrade a request if
+            CFNetwork as already upgraded it during
+            canonicalization. This allows the rest of 
+            WebKit's processing to function, such as UIR
+            and mixed content blocking.
+        (updateIgnoreStrictTransportSecuritySettingIfNecessary):
+            Adds and removed the ignore request accordingly.
+        (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
+            Now asks CFNetwork to ignore HSTS on resource loads we
+            partition cookies for.
+        (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
+            Now asks CFNetwork to ignore HSTS on resource loads we
+            partition cookies for.
+
</ins><span class="cx"> 2017-11-10  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         _WKThumbnailView initialization with WKWebView needs to call correct initWithFrame
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscocoaNetworkSessionCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (224697 => 224698)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm  2017-11-10 19:01:39 UTC (rev 224697)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm     2017-11-10 19:06:50 UTC (rev 224698)
</span><span class="lines">@@ -165,6 +165,46 @@
</span><span class="cx">     completionHandler(WebCore::createHTTPBodyNSInputStream(*body).get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if USE(CFNETWORK_IGNORE_HSTS)
+static NSURLRequest* downgradeRequest(NSURLRequest *request)
+{
+    NSMutableURLRequest *nsMutableRequest = [[request mutableCopy] autorelease];
+    if ([nsMutableRequest.URL.scheme isEqualToString:@"https"]) {
+        NSURLComponents *components = [[NSURLComponents componentsWithURL:nsMutableRequest.URL resolvingAgainstBaseURL:NO] autorelease];
+        components.scheme = @"http";
+        [nsMutableRequest setURL:components.URL];
+        ASSERT([nsMutableRequest.URL.scheme isEqualToString:@"http"]);
+        return nsMutableRequest;
+    }
+
+    ASSERT_NOT_REACHED();
+    return request;
+}
+#endif
+
+static NSURLRequest* updateIgnoreStrictTransportSecuritySettingIfNecessary(NSURLRequest *request, bool shouldIgnoreHSTS)
+{
+#if USE(CFNETWORK_IGNORE_HSTS)
+    if ([request.URL.scheme isEqualToString:@"https"] && shouldIgnoreHSTS && ignoreHSTS(request)) {
+        // The request was upgraded for some other reason than HSTS.
+        // Don't ignore HSTS to avoid the risk of another downgrade.
+        NSMutableURLRequest *nsMutableRequest = [[request mutableCopy] autorelease];
+        setIgnoreHSTS(nsMutableRequest, false);
+        return nsMutableRequest;
+    }
+    
+    if ([request.URL.scheme isEqualToString:@"http"] && ignoreHSTS(request) != shouldIgnoreHSTS) {
+        NSMutableURLRequest *nsMutableRequest = [[request mutableCopy] autorelease];
+        setIgnoreHSTS(nsMutableRequest, shouldIgnoreHSTS);
+        return nsMutableRequest;
+    }
+#else
+    UNUSED_PARAM(shouldIgnoreHSTS);
+#endif
+
+    return request;
+}
+
</ins><span class="cx"> - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest *))completionHandler
</span><span class="cx"> {
</span><span class="cx">     auto taskIdentifier = task.taskIdentifier;
</span><span class="lines">@@ -172,13 +212,26 @@
</span><span class="cx"> 
</span><span class="cx">     if (auto* networkDataTask = [self existingTask:task]) {
</span><span class="cx">         auto completionHandlerCopy = Block_copy(completionHandler);
</span><del>-        networkDataTask->willPerformHTTPRedirection(response, request, [completionHandlerCopy, taskIdentifier](auto&& request) {
</del><ins>+
+        bool shouldIgnoreHSTS = false;
+#if USE(CFNETWORK_IGNORE_HSTS)
+        shouldIgnoreHSTS = schemeWasUpgradedDueToDynamicHSTS(request) && !(WebCore::NetworkStorageSession::storageSession(_session->sessionID())->cookieStoragePartition(request)).isEmpty();
+        if (shouldIgnoreHSTS) {
+            request = downgradeRequest(request);
+            ASSERT([request.URL.scheme isEqualToString:@"http"]);
+            LOG(NetworkSession, "%llu Downgraded %s from https to http", taskIdentifier, request.URL.absoluteString.UTF8String);
+        }
+#endif
+
+        networkDataTask->willPerformHTTPRedirection(response, request, [completionHandlerCopy, taskIdentifier, shouldIgnoreHSTS](auto&& request) {
</ins><span class="cx"> #if !LOG_DISABLED
</span><span class="cx">             LOG(NetworkSession, "%llu willPerformHTTPRedirection completionHandler (%s)", taskIdentifier, request.url().string().utf8().data());
</span><span class="cx"> #else
</span><span class="cx">             UNUSED_PARAM(taskIdentifier);
</span><span class="cx"> #endif
</span><del>-            completionHandlerCopy(request.nsURLRequest(WebCore::UpdateHTTPBody));
</del><ins>+            auto nsRequest = request.nsURLRequest(WebCore::UpdateHTTPBody);
+            nsRequest = updateIgnoreStrictTransportSecuritySettingIfNecessary(nsRequest, shouldIgnoreHSTS);
+            completionHandlerCopy(nsRequest);
</ins><span class="cx">             Block_release(completionHandlerCopy);
</span><span class="cx">         });
</span><span class="cx">     } else {
</span><span class="lines">@@ -191,16 +244,28 @@
</span><span class="cx"> {
</span><span class="cx">     auto taskIdentifier = task.taskIdentifier;
</span><span class="cx">     LOG(NetworkSession, "%llu _schemeUpgraded %s", taskIdentifier, request.URL.absoluteString.UTF8String);
</span><del>-    
</del><ins>+
+    bool shouldIgnoreHSTS = false;
+#if USE(CFNETWORK_IGNORE_HSTS)
+    shouldIgnoreHSTS = schemeWasUpgradedDueToDynamicHSTS(request) && !(WebCore::NetworkStorageSession::storageSession(_session->sessionID())->cookieStoragePartition(request)).isEmpty();
+    if (shouldIgnoreHSTS) {
+        request = downgradeRequest(request);
+        ASSERT([request.URL.scheme isEqualToString:@"http"]);
+        LOG(NetworkSession, "%llu Downgraded %s from https to http", taskIdentifier, request.URL.absoluteString.UTF8String);
+    }
+#endif
+
</ins><span class="cx">     if (auto* networkDataTask = [self existingTask:task]) {
</span><span class="cx">         auto completionHandlerCopy = Block_copy(completionHandler);
</span><del>-        networkDataTask->willPerformHTTPRedirection(WebCore::synthesizeRedirectResponseIfNecessary([task currentRequest], request, nil), request, [completionHandlerCopy, taskIdentifier](auto&& request) {
</del><ins>+        networkDataTask->willPerformHTTPRedirection(WebCore::synthesizeRedirectResponseIfNecessary([task currentRequest], request, nil), request, [completionHandlerCopy, taskIdentifier, shouldIgnoreHSTS](auto&& request) {
</ins><span class="cx"> #if !LOG_DISABLED
</span><span class="cx">             LOG(NetworkSession, "%llu _schemeUpgraded completionHandler (%s)", taskIdentifier, request.url().string().utf8().data());
</span><span class="cx"> #else
</span><span class="cx">             UNUSED_PARAM(taskIdentifier);
</span><span class="cx"> #endif
</span><del>-            completionHandlerCopy(request.nsURLRequest(WebCore::UpdateHTTPBody));
</del><ins>+            auto nsRequest = request.nsURLRequest(WebCore::UpdateHTTPBody);
+            nsRequest = updateIgnoreStrictTransportSecuritySettingIfNecessary(nsRequest, shouldIgnoreHSTS);
+            completionHandlerCopy(nsRequest);
</ins><span class="cx">             Block_release(completionHandlerCopy);
</span><span class="cx">         });
</span><span class="cx">     } else {
</span></span></pre>
</div>
</div>

</body>
</html>