Title: [168498] trunk
Revision
168498
Author
mmaxfi...@apple.com
Date
2014-05-08 15:03:33 -0700 (Thu, 08 May 2014)

Log Message

http/tests/security/xss-DENIED-xsl-document-redirect.xml fails with NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=132523

Reviewed by Alexey Proskuryakov.

Source/WebCore:
We should not manufacture a response in the event of an error during a
synchronous XHR. In addition, this test removes one place that is
sensitive to such a manufactured response.

Updates test expectations.

* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Do not
manufacture a response
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Do not
manufacture a response
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::docLoaderFunc): Only use the response's URL if no error
occurred.

LayoutTests:
Two tests have been rebaselined, and re-enable test that now passes

* fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt: The test describes
that success causes an ErrorHandler to run, but there was no ErrorHandler line in the
expected output. This now gets printed.
* http/tests/security/xss-DENIED-xsl-document-redirect-expected.txt: Expecting logging
output on failed redirection
* platform/mac-wk2/TestExpectations: Re-enable test that now passes.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (168497 => 168498)


--- trunk/LayoutTests/ChangeLog	2014-05-08 21:51:03 UTC (rev 168497)
+++ trunk/LayoutTests/ChangeLog	2014-05-08 22:03:33 UTC (rev 168498)
@@ -1,3 +1,19 @@
+2014-05-08  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        http/tests/security/xss-DENIED-xsl-document-redirect.xml fails with NetworkProcess
+        https://bugs.webkit.org/show_bug.cgi?id=132523
+
+        Reviewed by Alexey Proskuryakov.
+
+        Two tests have been rebaselined, and re-enable test that now passes
+
+        * fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt: The test describes
+        that success causes an ErrorHandler to run, but there was no ErrorHandler line in the
+        expected output. This now gets printed.
+        * http/tests/security/xss-DENIED-xsl-document-redirect-expected.txt: Expecting logging
+        output on failed redirection
+        * platform/mac-wk2/TestExpectations: Re-enable test that now passes.
+
 2014-05-08  Bem Jones-Bey  <bjone...@adobe.com>
 
         [CSS Shapes] Shapes do not resolve dimensions specified in viewport units

Modified: trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt (168497 => 168498)


--- trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt	2014-05-08 21:51:03 UTC (rev 168497)
+++ trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt	2014-05-08 22:03:33 UTC (rev 168498)
@@ -11,4 +11,5 @@
 Doing an XHR to a directory.
 ReadyState handler: readyState = 1
 ReadyState handler: readyState = 4
+Error handler: readyState = 4
 

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (168497 => 168498)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2014-05-08 21:51:03 UTC (rev 168497)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2014-05-08 22:03:33 UTC (rev 168498)
@@ -406,9 +406,6 @@
 webkit.org/b/123431 [ Mavericks ] http/tests/local/link-stylesheet-load-order-preload.html [ Failure ]
 webkit.org/b/123431 [ Mavericks ] http/tests/local/link-stylesheet-load-order.html [ Failure ]
 
-# passes but has different logging
-[ Mavericks ] http/tests/security/xss-DENIED-xsl-document-redirect.xml [ Failure ]
-
 # test results in DRT don't match in browser behavior, test seems broken
 fast/dom/Window/mozilla-focus-blur.html [ Failure ]
 

Modified: trunk/Source/WebCore/ChangeLog (168497 => 168498)


--- trunk/Source/WebCore/ChangeLog	2014-05-08 21:51:03 UTC (rev 168497)
+++ trunk/Source/WebCore/ChangeLog	2014-05-08 22:03:33 UTC (rev 168498)
@@ -1,3 +1,26 @@
+2014-05-08  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        http/tests/security/xss-DENIED-xsl-document-redirect.xml fails with NetworkProcess
+        https://bugs.webkit.org/show_bug.cgi?id=132523
+
+        Reviewed by Alexey Proskuryakov.
+
+        We should not manufacture a response in the event of an error during a
+        synchronous XHR. In addition, this test removes one place that is
+        sensitive to such a manufactured response.
+
+        Updates test expectations.
+
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        (WebCore::ResourceHandle::platformLoadResourceSynchronously): Do not
+        manufacture a response
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::platformLoadResourceSynchronously): Do not
+        manufacture a response
+        * xml/XSLTProcessorLibxslt.cpp:
+        (WebCore::docLoaderFunc): Only use the response's URL if no error
+        occurred.
+
 2014-05-08  Andreas Kling  <akl...@apple.com>
 
         [iOS] WebKit should listen to critical memory warnings.

Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp (168497 => 168498)


--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp	2014-05-08 21:51:03 UTC (rev 168497)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp	2014-05-08 22:03:33 UTC (rev 168498)
@@ -508,14 +508,6 @@
 
     if (error.isNull())
         response = client->response();
-    else {
-        response = ResourceResponse(request.url(), String(), 0, String(), String());
-        // FIXME: ResourceHandleMac also handles authentication errors by setting code to 401. CFNet version should probably do the same.
-        if (error.domain() == String(kCFErrorDomainCFNetwork))
-            response.setHTTPStatusCode(error.errorCode());
-        else
-            response.setHTTPStatusCode(404);
-    }
 
     data.swap(client->mutableData());
 }

Modified: trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (168497 => 168498)


--- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm	2014-05-08 21:51:03 UTC (rev 168497)
+++ trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm	2014-05-08 22:03:33 UTC (rev 168498)
@@ -414,25 +414,6 @@
 
     if (error.isNull())
         response = client->response();
-    else {
-        // FIXME: We might not ever need to manufacture a response: This might all be dead code.
-        // When exploring removal of this code, we should substitute appropriate ASSERTs.
-        response = ResourceResponse(request.url(), String(), 0, String(), String());
-        if (error.domain() == String(NSURLErrorDomain))
-            switch (error.errorCode()) {
-            case NSURLErrorUserCancelledAuthentication:
-                // FIXME: We don't need to manufacture a 401 response if we say continueWithoutCredentialForAuthenticationChallenge:
-                // in which case we'll get the real failure response. A reading of SynchronousLoaderClient.mm suggests we already do this.
-                response.setHTTPStatusCode(401);
-                break;
-            default:
-                response.setHTTPStatusCode(error.errorCode());
-            }
-        else {
-            // FIXME: This is wrong. We shouldn't need to ever make up a 404.
-            response.setHTTPStatusCode(404);
-        }
-     }
 
     data.swap(client->mutableData());
 }

Modified: trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp (168497 => 168498)


--- trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp	2014-05-08 21:51:03 UTC (rev 168497)
+++ trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp	2014-05-08 22:03:33 UTC (rev 168498)
@@ -128,7 +128,10 @@
         bool requestAllowed = globalCachedResourceLoader->frame() && globalCachedResourceLoader->document()->securityOrigin()->canRequest(url);
         if (requestAllowed) {
             globalCachedResourceLoader->frame()->loader().loadResourceSynchronously(url, AllowStoredCredentials, DoNotAskClientForCrossOriginCredentials, error, response, data);
-            requestAllowed = globalCachedResourceLoader->document()->securityOrigin()->canRequest(response.url());
+            if (error.isNull())
+                requestAllowed = globalCachedResourceLoader->document()->securityOrigin()->canRequest(response.url());
+            else
+                data.clear();
         }
         if (!requestAllowed) {
             data.clear();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to