Unregistered blob URLs have incorrect MIME type
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Feb 2013 18:05:47 +0000 (18:05 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Feb 2013 18:05:47 +0000 (18:05 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=110166

        Reviewed by Sam Weinig.

        * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::shouldUseInnerURL): Added a FIXME.

        * platform/network/BlobResourceHandle.cpp: (WebCore::BlobResourceHandle::notifyResponseOnError):
        Pass an accurate MIME type (for a delegate to see).

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

Source/WebCore/ChangeLog
Source/WebCore/page/SecurityOrigin.cpp
Source/WebCore/platform/network/BlobResourceHandle.cpp

index d2e3347..78e883b 100644 (file)
@@ -1,3 +1,15 @@
+2013-02-18  Alexey Proskuryakov  <ap@apple.com>
+
+        Unregistered blob URLs have incorrect MIME type
+        https://bugs.webkit.org/show_bug.cgi?id=110166
+
+        Reviewed by Sam Weinig.
+
+        * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::shouldUseInnerURL): Added a FIXME.
+
+        * platform/network/BlobResourceHandle.cpp: (WebCore::BlobResourceHandle::notifyResponseOnError):
+        Pass an accurate MIME type (for a delegate to see).
+
 2013-02-19  Joshua Bell  <jsbell@chromium.org>
 
         IndexedDB: additional checks on LevelDB decoding
index 8408259..fe58e8e 100644 (file)
@@ -56,6 +56,7 @@ static bool schemeRequiresAuthority(const KURL& url)
 bool SecurityOrigin::shouldUseInnerURL(const KURL& url)
 {
 #if ENABLE(BLOB)
+    // FIXME: Blob URLs don't have inner URLs. Their form is "blob:<inner-origin>/<UUID>", so treating the part after "blob:" as a URL is incorrect.
     if (url.protocolIs("blob"))
         return true;
 #endif
index e81334c..d3d6880 100644 (file)
@@ -573,7 +573,7 @@ void BlobResourceHandle::notifyResponseOnError()
 {
     ASSERT(m_errorCode);
 
-    ResourceResponse response(firstRequest().url(), String(), 0, String(), String());
+    ResourceResponse response(firstRequest().url(), "text/plain", 0, String(), String());
     switch (m_errorCode) {
     case rangeError:
         response.setHTTPStatusCode(httpRequestedRangeNotSatisfiable);