Title: [118402] trunk/Source/WebCore
Revision
118402
Author
[email protected]
Date
2012-05-24 12:27:36 -0700 (Thu, 24 May 2012)

Log Message

MHTML files should be loadable from all schemes considered local,
not just "file:"

https://bugs.webkit.org/show_bug.cgi?id=86540

Patch by Greg Spencer <[email protected]> on 2012-05-24
Reviewed by Adam Barth.

Existing tests should verify correct function.

* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::continueAfterContentPolicy):
* loader/archive/mhtml/MHTMLArchive.cpp:
(WebCore::MHTMLArchive::create):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (118401 => 118402)


--- trunk/Source/WebCore/ChangeLog	2012-05-24 19:09:05 UTC (rev 118401)
+++ trunk/Source/WebCore/ChangeLog	2012-05-24 19:27:36 UTC (rev 118402)
@@ -1,3 +1,19 @@
+2012-05-24  Greg Spencer  <[email protected]>
+
+        MHTML files should be loadable from all schemes considered local,
+        not just "file:"
+
+        https://bugs.webkit.org/show_bug.cgi?id=86540
+
+        Reviewed by Adam Barth.
+
+        Existing tests should verify correct function.
+
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::continueAfterContentPolicy):
+        * loader/archive/mhtml/MHTMLArchive.cpp:
+        (WebCore::MHTMLArchive::create):
+
 2012-05-24  Dana Jansens  <[email protected]>
 
         [chromium] Remove some leftover references to LayerTilerChromium

Modified: trunk/Source/WebCore/loader/MainResourceLoader.cpp (118401 => 118402)


--- trunk/Source/WebCore/loader/MainResourceLoader.cpp	2012-05-24 19:09:05 UTC (rev 118401)
+++ trunk/Source/WebCore/loader/MainResourceLoader.cpp	2012-05-24 19:27:36 UTC (rev 118402)
@@ -267,10 +267,10 @@
     case PolicyUse: {
         // Prevent remote web archives from loading because they can claim to be from any domain and thus avoid cross-domain security checks (4120255).
         bool isRemoteWebArchive = (equalIgnoringCase("application/x-webarchive", mimeType) || equalIgnoringCase("multipart/related", mimeType))
-            && !m_substituteData.isValid() && !url.isLocalFile();
+            && !m_substituteData.isValid() && !SchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol());
         if (!frameLoader()->client()->canShowMIMEType(mimeType) || isRemoteWebArchive) {
             frameLoader()->policyChecker()->cannotShowMIMEType(r);
-            // Check reachedTerminalState since the load may have already been cancelled inside of _handleUnimplementablePolicyWithErrorCode::.
+            // Check reachedTerminalState since the load may have already been canceled inside of _handleUnimplementablePolicyWithErrorCode::.
             if (!reachedTerminalState())
                 stopLoadingForPolicyChange();
             return;

Modified: trunk/Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp (118401 => 118402)


--- trunk/Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp	2012-05-24 19:09:05 UTC (rev 118401)
+++ trunk/Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp	2012-05-24 19:27:36 UTC (rev 118402)
@@ -41,6 +41,7 @@
 #include "Page.h"
 #include "PageSerializer.h"
 #include "QuotedPrintable.h"
+#include "SchemeRegistry.h"
 #include "SharedBuffer.h"
 
 #include <wtf/CryptographicallyRandomNumber.h>
@@ -102,8 +103,8 @@
 
 PassRefPtr<MHTMLArchive> MHTMLArchive::create(const KURL& url, SharedBuffer* data)
 {
-    // For security reasons we only load MHTML pages from the local file system.
-    if (!url.isLocalFile())
+    // For security reasons we only load MHTML pages from local URLs.
+    if (!SchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol()))
         return 0;
 
     MHTMLParser parser(data);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to