Changeset 120035 in webkit


Ignore:
Timestamp:
Jun 11, 2012 8:44:38 PM (12 years ago)
Author:
mary.wu@torchmobile.com.cn
Message:

[BlackBerry] Wrong mimetype for empty file link
https://bugs.webkit.org/show_bug.cgi?id=88642

Reviewed by Rob Buis.

RIM PR# 164164

For empty file link, we shouldn't give "application/octet-stream"
which will lead to download.

Reviewed internally by Charles Wei.

  • platform/network/blackberry/NetworkJob.cpp:

(WebCore::NetworkJob::sendResponseIfNeeded):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r120033 r120035  
     12012-06-11  Mary Wu  <mary.wu@torchmobile.com.cn>
     2
     3        [BlackBerry] Wrong mimetype for empty file link
     4        https://bugs.webkit.org/show_bug.cgi?id=88642
     5
     6        Reviewed by Rob Buis.
     7
     8        RIM PR# 164164
     9
     10        For empty file link, we shouldn't give "application/octet-stream"
     11        which will lead to download.
     12
     13        Reviewed internally by Charles Wei.
     14
     15        * platform/network/blackberry/NetworkJob.cpp:
     16        (WebCore::NetworkJob::sendResponseIfNeeded):
     17
    1182012-06-11  Jin Yang  <jin.a.yang@intel.com>
    219
  • trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp

    r118991 r120035  
    619619    if (m_isFTP && m_isFTPDir)
    620620        mimeType = "application/x-ftp-directory";
    621     if (mimeType.isNull())
     621    else if (mimeType.isNull())
    622622        mimeType = extractMIMETypeFromMediaType(m_contentType);
    623     if (mimeType.isNull())
    624         mimeType = MIMETypeRegistry::getMIMETypeForPath(urlFilename);
     623    if (mimeType.isNull()) {
     624        if (m_dataReceived)
     625            mimeType = MIMETypeRegistry::getMIMETypeForPath(urlFilename);
     626        else
     627            // For empty content, we shouldn't download.
     628            mimeType = "text/plain";
     629    }
    625630    m_response.setMimeType(mimeType);
    626631
Note: See TracChangeset for help on using the changeset viewer.