<!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>[202162] trunk</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/202162">202162</a></dd>
<dt>Author</dt> <dd>youenn.fablet@crf.canon.fr</dd>
<dt>Date</dt> <dd>2016-06-17 03:34:02 -0700 (Fri, 17 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>CORS preflight with a non-200 response should be a preflight failure
https://bugs.webkit.org/show_bug.cgi?id=111008

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/XMLHttpRequest/data-uri-expected.txt:

Source/WebCore:

Covered by rebased tests.

* Modules/fetch/FetchResponse.h: Making use of ResourceResponse::isSuccessful.
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse): Checking that response status is code is
successful. If not, calling preflight failure callback.
(WebCore::CrossOriginPreflightChecker::startPreflight): Putting in manual redirection mode so that redirection
responses are processed as other responses.
* loader/ResourceLoaderOptions.h:
(WebCore::ResourceLoaderOptions::fetchOptions): Adding a non-const getter and fixing const getter to return a
const reference.
(WebCore::ResourceLoaderOptions::setFetchOptions): Passing options by reference.
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::isSuccessful): Utility function.
* platform/network/ResourceResponseBase.h:

LayoutTests:

* http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt:
* http/tests/xmlhttprequest/access-control-and-redirects-async.html:
* http/tests/xmlhttprequest/access-control-basic-get-fail-non-simple-expected.txt:
* http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestaccesscontrolandredirectsasyncexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestaccesscontrolandredirectsasynchtml">trunk/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async.html</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestaccesscontrolbasicgetfailnonsimpleexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/access-control-basic-get-fail-non-simple-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestworkersaccesscontrolbasicgetfailnonsimpleexpectedtxt">trunk/LayoutTests/http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsXMLHttpRequestdatauriexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/data-uri-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchResponseh">trunk/Source/WebCore/Modules/fetch/FetchResponse.h</a></li>
<li><a href="#trunkSourceWebCoreloaderCrossOriginPreflightCheckercpp">trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoaderOptionsh">trunk/Source/WebCore/loader/ResourceLoaderOptions.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceResponseBasecpp">trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceResponseBaseh">trunk/Source/WebCore/platform/network/ResourceResponseBase.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/LayoutTests/ChangeLog        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-06-17  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        CORS preflight with a non-200 response should be a preflight failure
+        https://bugs.webkit.org/show_bug.cgi?id=111008
+
+        Reviewed by Darin Adler.
+
+        * http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt:
+        * http/tests/xmlhttprequest/access-control-and-redirects-async.html:
+        * http/tests/xmlhttprequest/access-control-basic-get-fail-non-simple-expected.txt:
+        * http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt:
+
</ins><span class="cx"> 2016-06-17  Frederic Wang  &lt;fred.wang@free.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         MathOperator: Add fallback mechanisms for stretching and mirroring radical symbols
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestaccesscontrolandredirectsasyncexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><ins>+CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/redirect-cors.php?redirect-preflight=true&amp;%20%20url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi&amp;%20%20access-control-allow-origin=*. Preflight response is not successful
</ins><span class="cx"> Tests that asynchronous XMLHttpRequests handle redirects according to the CORS standard.
</span><span class="cx"> 
</span><span class="cx"> Testing http://localhost:8000/xmlhttprequest/resources/redirect-cors.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi without credentials
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestaccesscontrolandredirectsasynchtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async.html (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async.html        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async.html        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -24,12 +24,13 @@
</span><span class="cx"> 
</span><span class="cx">     xhr.onload = function() {
</span><span class="cx">         log((expectSuccess ? &quot;PASS&quot; : &quot;FAIL&quot;) + &quot;: &quot; + xhr.responseText);
</span><del>-        nextTest();
</del><span class="cx">     }
</span><span class="cx">     xhr.onerror = function() {
</span><span class="cx">         log((expectSuccess ? &quot;FAIL&quot; : &quot;PASS&quot;) + &quot;: &quot; + xhr.status);
</span><del>-        nextTest();
</del><span class="cx">     }
</span><ins>+    xhr.onloadend = function() {
+         nextTest();
+    }
</ins><span class="cx">     xhr.send(null);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestaccesscontrolbasicgetfailnonsimpleexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/access-control-basic-get-fail-non-simple-expected.txt (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/access-control-basic-get-fail-non-simple-expected.txt        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/access-control-basic-get-fail-non-simple-expected.txt        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><del>-CONSOLE MESSAGE: line 28: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/access-control-basic-get-fail-non-simple.cgi. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
</del><ins>+CONSOLE MESSAGE: line 28: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/access-control-basic-get-fail-non-simple.cgi. Preflight response is not successful
</ins><span class="cx"> PASS: Exception thrown. Cross-domain access was denied in 'send'. [NetworkError: DOM Exception 19].
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestworkersaccesscontrolbasicgetfailnonsimpleexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/access-control-basic-get-fail-non-simple.cgi. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
</del><ins>+CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/access-control-basic-get-fail-non-simple.cgi. Preflight response is not successful
</ins><span class="cx"> GET should not trigger a preflight request from a worker unless it has non-simple headers.
</span><span class="cx"> 
</span><span class="cx"> PASS: Cross-domain access allowed for simple get.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2016-06-17  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        CORS preflight with a non-200 response should be a preflight failure
+        https://bugs.webkit.org/show_bug.cgi?id=111008
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/XMLHttpRequest/data-uri-expected.txt:
+
</ins><span class="cx"> 2016-06-16  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         :in-range &amp; :out-of-range CSS pseudo-classes shouldn't match disabled or readonly inputs
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsXMLHttpRequestdatauriexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/data-uri-expected.txt (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/data-uri-expected.txt        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/data-uri-expected.txt        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -5,9 +5,9 @@
</span><span class="cx"> CONSOLE MESSAGE: line 40: XMLHttpRequest cannot load data:image/png,Hello, World!. Cross origin requests are only supported for HTTP.
</span><span class="cx"> CONSOLE MESSAGE: line 40: XMLHttpRequest cannot load data:text/plain,Hello, World!. Cross origin requests are only supported for HTTP.
</span><span class="cx"> CONSOLE MESSAGE: line 40: XMLHttpRequest cannot load data:text/plain,Hello, World!. Cross origin requests are only supported for HTTP.
</span><del>-CONSOLE MESSAGE: XMLHttpRequest cannot load data:text/plain,Hello, World!. Origin http://localhost:8800 is not allowed by Access-Control-Allow-Origin.
-CONSOLE MESSAGE: XMLHttpRequest cannot load data:text/plain,Hello, World!. Origin http://localhost:8800 is not allowed by Access-Control-Allow-Origin.
-CONSOLE MESSAGE: XMLHttpRequest cannot load data:text/plain,Hello, World!. Origin http://localhost:8800 is not allowed by Access-Control-Allow-Origin.
</del><ins>+CONSOLE MESSAGE: XMLHttpRequest cannot load data:text/plain,Hello, World!. Preflight response is not successful
+CONSOLE MESSAGE: XMLHttpRequest cannot load data:text/plain,Hello, World!. Preflight response is not successful
+CONSOLE MESSAGE: XMLHttpRequest cannot load data:text/plain,Hello, World!. Preflight response is not successful
</ins><span class="cx"> 
</span><span class="cx"> FAIL XHR method GET with charset text/plain assert_equals: expected &quot;Hello, World!&quot; but got &quot;&quot;
</span><span class="cx"> FAIL XHR method GET with charset text/plain (base64) assert_equals: expected &quot;Hello, World!&quot; but got &quot;&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/Source/WebCore/ChangeLog        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-06-17  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        CORS preflight with a non-200 response should be a preflight failure
+        https://bugs.webkit.org/show_bug.cgi?id=111008
+
+        Reviewed by Darin Adler.
+
+        Covered by rebased tests.
+
+        * Modules/fetch/FetchResponse.h: Making use of ResourceResponse::isSuccessful.
+        * loader/CrossOriginPreflightChecker.cpp:
+        (WebCore::CrossOriginPreflightChecker::validatePreflightResponse): Checking that response status is code is
+        successful. If not, calling preflight failure callback.
+        (WebCore::CrossOriginPreflightChecker::startPreflight): Putting in manual redirection mode so that redirection
+        responses are processed as other responses.
+        * loader/ResourceLoaderOptions.h:
+        (WebCore::ResourceLoaderOptions::fetchOptions): Adding a non-const getter and fixing const getter to return a
+        const reference.
+        (WebCore::ResourceLoaderOptions::setFetchOptions): Passing options by reference.
+        * platform/network/ResourceResponseBase.cpp:
+        (WebCore::ResourceResponseBase::isSuccessful): Utility function.
+        * platform/network/ResourceResponseBase.h:
+
</ins><span class="cx"> 2016-06-17  Frederic Wang  &lt;fwang@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         MathOperator: Add fallback mechanisms for stretching and mirroring radical symbols
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchResponseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchResponse.h (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchResponse.h        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.h        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">     const String&amp; url() const { return m_response.url().string(); }
</span><span class="cx">     bool redirected() const { return m_response.isRedirected(); }
</span><span class="cx">     int status() const { return m_response.httpStatusCode(); }
</span><del>-    bool ok() const { return status() &gt;= 200 &amp;&amp; status() &lt;= 299; }
</del><ins>+    bool ok() const { return m_response.isSuccessful(); }
</ins><span class="cx">     const String&amp; statusText() const { return m_response.httpStatusText(); }
</span><span class="cx"> 
</span><span class="cx">     FetchHeaders&amp; headers() { return m_headers; }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderCrossOriginPreflightCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -72,9 +72,14 @@
</span><span class="cx">     auto cookie = InspectorInstrumentation::willReceiveResourceResponse(frame);
</span><span class="cx">     InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, frame-&gt;loader().documentLoader(), response, 0);
</span><span class="cx"> 
</span><ins>+    if (!response.isSuccessful()) {
+        loader.preflightFailure(identifier, ResourceError(errorDomainWebKitInternal, 0, request.url(), ASCIILiteral(&quot;Preflight response is not successful&quot;)));
+        return;
+    }
+
</ins><span class="cx">     String description;
</span><span class="cx">     if (!passesAccessControlCheck(response, loader.options().allowCredentials(), loader.securityOrigin(), description)) {
</span><del>-        loader.preflightFailure(identifier, ResourceError(errorDomainWebKitInternal, 0, response.url(), description));
</del><ins>+        loader.preflightFailure(identifier, ResourceError(errorDomainWebKitInternal, 0, request.url(), description));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -82,7 +87,7 @@
</span><span class="cx">     if (!result-&gt;parse(response, description)
</span><span class="cx">         || !result-&gt;allowsCrossOriginMethod(request.httpMethod(), description)
</span><span class="cx">         || !result-&gt;allowsCrossOriginHeaders(request.httpHeaderFields(), description)) {
</span><del>-        loader.preflightFailure(identifier, ResourceError(errorDomainWebKitInternal, 0, response.url(), description));
</del><ins>+        loader.preflightFailure(identifier, ResourceError(errorDomainWebKitInternal, 0, request.url(), description));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -111,6 +116,8 @@
</span><span class="cx">     // Keep buffering the data for the preflight request.
</span><span class="cx">     options.setDataBufferingPolicy(BufferData);
</span><span class="cx"> 
</span><ins>+    options.fetchOptions().redirect = FetchOptions::Redirect::Manual;
+
</ins><span class="cx">     CachedResourceRequest preflightRequest(createAccessControlPreflightRequest(m_request, m_loader.securityOrigin()), options);
</span><span class="cx">     if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
</span><span class="cx">         preflightRequest.setInitiator(m_loader.options().initiator);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoaderOptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoaderOptions.h (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoaderOptions.h        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/Source/WebCore/loader/ResourceLoaderOptions.h        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -136,8 +136,9 @@
</span><span class="cx">     void setDefersLoadingPolicy(DefersLoadingPolicy defersLoadingPolicy) { m_defersLoadingPolicy = defersLoadingPolicy; }
</span><span class="cx">     CachingPolicy cachingPolicy() const { return m_cachingPolicy; }
</span><span class="cx">     void setCachingPolicy(CachingPolicy cachingPolicy) { m_cachingPolicy = cachingPolicy; }
</span><del>-    FetchOptions fetchOptions() const { return m_fetchOptions; }
-    void setFetchOptions(FetchOptions fetchOptions) { m_fetchOptions = fetchOptions; }
</del><ins>+    const FetchOptions&amp; fetchOptions() const { return m_fetchOptions; }
+    FetchOptions&amp; fetchOptions() { return m_fetchOptions; }
+    void setFetchOptions(const FetchOptions&amp; fetchOptions) { m_fetchOptions = fetchOptions; }
</ins><span class="cx"> 
</span><span class="cx">     unsigned m_sendLoadCallbacks : 1;
</span><span class="cx">     unsigned m_sniffContent : 1;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceResponseBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -193,6 +193,12 @@
</span><span class="cx">     return static_cast&lt;const ResourceResponse*&gt;(this)-&gt;platformSuggestedFilename();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ResourceResponseBase::isSuccessful() const
+{
+    int code = httpStatusCode();
+    return code &gt;= 200 &amp;&amp; code &lt; 300;
+}
+
</ins><span class="cx"> int ResourceResponseBase::httpStatusCode() const
</span><span class="cx"> {
</span><span class="cx">     lazyInit(CommonFieldsOnly);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceResponseBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceResponseBase.h (202161 => 202162)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceResponseBase.h        2016-06-17 09:24:49 UTC (rev 202161)
+++ trunk/Source/WebCore/platform/network/ResourceResponseBase.h        2016-06-17 10:34:02 UTC (rev 202162)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool isNull() const { return m_isNull; }
</span><span class="cx">     WEBCORE_EXPORT bool isHTTP() const;
</span><ins>+    bool isSuccessful() const;
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT const URL&amp; url() const;
</span><span class="cx">     WEBCORE_EXPORT void setURL(const URL&amp;);
</span><span class="lines">@@ -85,7 +86,7 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT int httpStatusCode() const;
</span><span class="cx">     WEBCORE_EXPORT void setHTTPStatusCode(int);
</span><del>-    
</del><ins>+
</ins><span class="cx">     WEBCORE_EXPORT const String&amp; httpStatusText() const;
</span><span class="cx">     WEBCORE_EXPORT void setHTTPStatusText(const String&amp;);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>