Title: [121410] trunk/Source/WebCore
Revision
121410
Author
[email protected]
Date
2012-06-27 23:09:50 -0700 (Wed, 27 Jun 2012)

Log Message

[BlackBerry] 0-length response with no content-type shouldn't download
https://bugs.webkit.org/show_bug.cgi?id=89860

Reviewed by Rob Buis.

RIM PR# 168419

For 0-length response, if we can't get its mimetype from the filename,
we set the mimetype to "text/plain" instead of "application/octet-stream",
so it won't go to download.

Reviewed internally by Charles Wei.

* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::sendResponseIfNeeded):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (121409 => 121410)


--- trunk/Source/WebCore/ChangeLog	2012-06-28 05:36:01 UTC (rev 121409)
+++ trunk/Source/WebCore/ChangeLog	2012-06-28 06:09:50 UTC (rev 121410)
@@ -1,3 +1,21 @@
+2012-06-27  Mary Wu  <[email protected]>
+
+        [BlackBerry] 0-length response with no content-type shouldn't download
+        https://bugs.webkit.org/show_bug.cgi?id=89860
+
+        Reviewed by Rob Buis.
+
+        RIM PR# 168419
+
+        For 0-length response, if we can't get its mimetype from the filename,
+        we set the mimetype to "text/plain" instead of "application/octet-stream",
+        so it won't go to download.
+
+        Reviewed internally by Charles Wei.
+
+        * platform/network/blackberry/NetworkJob.cpp:
+        (WebCore::NetworkJob::sendResponseIfNeeded):
+
 2012-06-27  Yoshifumi Inoue  <[email protected]>
 
         [Platform] Implement localizedDecimalSeparator function

Modified: trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp (121409 => 121410)


--- trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp	2012-06-28 05:36:01 UTC (rev 121409)
+++ trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp	2012-06-28 06:09:50 UTC (rev 121410)
@@ -625,12 +625,12 @@
         mimeType = "application/x-ftp-directory";
     else if (mimeType.isNull())
         mimeType = extractMIMETypeFromMediaType(m_contentType);
-    if (mimeType.isNull()) {
-        if (m_dataReceived)
-            mimeType = MIMETypeRegistry::getMIMETypeForPath(urlFilename);
-        else
-            // For empty content, we shouldn't download.
-            mimeType = "text/plain";
+    if (mimeType.isNull())
+        mimeType = MIMETypeRegistry::getMIMETypeForPath(urlFilename);
+    if (!m_dataReceived && mimeType == "application/octet-stream") {
+        // For empty content, if can't guess its mimetype from filename, we manually
+        // set the mimetype to "text/plain" in case it goes to download.
+        mimeType = "text/plain";
     }
     m_response.setMimeType(mimeType);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to