[Curl] Fix the bug when client reject the redirect on WebKitLegacy.
authorBasuke.Suzuki@sony.com <Basuke.Suzuki@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Jul 2018 16:18:32 +0000 (16:18 +0000)
committerBasuke.Suzuki@sony.com <Basuke.Suzuki@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Jul 2018 16:18:32 +0000 (16:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188130

Reviewed by Darin Adler.

Source/WebCore:

ResourceHandle for Curl port has a bug when a client returns en empty request which
indicates the redirecti is rejected by the client. It should be quit the task immediately,
but it kept doing the job. Fixed.
NetworkDataTask implementation did the right thing and there's no bug for them.

Test: http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt

* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::continueAfterWillSendRequest):

LayoutTests:

* platform/wincairo/TestExpectations:
- xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt: Pass

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234346 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/wincairo/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp

index 4c3a9bd..1dd1d52 100644 (file)
@@ -1,3 +1,13 @@
+2018-07-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
+
+        [Curl] Fix the bug when client reject the redirect on WebKitLegacy.
+        https://bugs.webkit.org/show_bug.cgi?id=188130
+
+        Reviewed by Darin Adler.
+
+        * platform/wincairo/TestExpectations:
+        - xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt: Pass
+
 2018-07-24  Simon Fraser  <simon.fraser@apple.com>
 
         Animation stops with object-fit:contain on an animated 2d canvas
index a74c02d..94a0c33 100644 (file)
@@ -929,7 +929,7 @@ http/tests/workers [ Skip ]
 
 http/tests/xmlhttprequest [ Skip ]
 http/tests/xmlhttprequest/simple-sync.html [ Pass ]
-http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect.html [ Failure ]
+http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect.html [ Pass ]
 
 http/tests/xmlviewer [ Skip ]
 http/tests/xsl [ Skip ]
index 2775997..7f68baa 100644 (file)
@@ -1,3 +1,20 @@
+2018-07-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
+
+        [Curl] Fix the bug when client reject the redirect on WebKitLegacy.
+        https://bugs.webkit.org/show_bug.cgi?id=188130
+
+        Reviewed by Darin Adler.
+
+        ResourceHandle for Curl port has a bug when a client returns en empty request which
+        indicates the redirecti is rejected by the client. It should be quit the task immediately,
+        but it kept doing the job. Fixed.
+        NetworkDataTask implementation did the right thing and there's no bug for them. 
+
+        Test: http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt
+
+        * platform/network/curl/ResourceHandleCurl.cpp:
+        (WebCore::ResourceHandle::continueAfterWillSendRequest):
+
 2018-07-28  Simon Fraser  <simon.fraser@apple.com>
 
         Reset CompositingPolicyOverride between tests
index 55592cb..641fe1b 100644 (file)
@@ -496,7 +496,7 @@ void ResourceHandle::continueAfterWillSendRequest(ResourceRequest&& request)
     ASSERT(isMainThread());
 
     // willSendRequest might cancel the load.
-    if (cancelledOrClientless() || !d->m_curlRequest)
+    if (cancelledOrClientless() || !d->m_curlRequest || request.isNull())
         return;
 
     auto wasSyncRequest = d->m_curlRequest->isSyncRequest();