Changeset 173314 in webkit


Ignore:
Timestamp:
Sep 5, 2014, 11:15:59 AM (10 years ago)
Author:
Antti Koivisto
Message:

REGRESSION(r173272): Two blob tests failing on WK1
https://bugs.webkit.org/show_bug.cgi?id=136573

Reviewed by Alexey Proskuryakov.

http/tests/fileapi/blob-url-in-subframe.html
http/tests/security/mixedContent/blob-url-in-iframe.html

  • platform/network/BlobResourceHandle.cpp:

(WebCore::BlobResourceHandle::notifyResponseOnSuccess):

No need to set this twice.

  • platform/network/mac/ResourceResponseMac.mm:

(WebCore::ResourceResponse::initNSURLResponse):

Also test that it is an HTTP URL before using NSHTTPURLResponse. Blobs create non-HTTP URLs with status codes.
Pass the accidentally lost expected content length.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r173311 r173314  
     12014-09-05  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION(r173272): Two blob tests failing on WK1
     4        https://bugs.webkit.org/show_bug.cgi?id=136573
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        http/tests/fileapi/blob-url-in-subframe.html
     9        http/tests/security/mixedContent/blob-url-in-iframe.html
     10
     11        * platform/network/BlobResourceHandle.cpp:
     12        (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
     13
     14            No need to set this twice.
     15
     16        * platform/network/mac/ResourceResponseMac.mm:
     17        (WebCore::ResourceResponse::initNSURLResponse):
     18
     19            Also test that it is an HTTP URL before using NSHTTPURLResponse. Blobs create non-HTTP URLs with status codes.
     20            Pass the accidentally lost expected content length.
     21
    1222014-09-05  Zalan Bujtas  <zalan@apple.com>
    223
  • trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp

    r173272 r173314  
    598598    bool isRangeRequest = m_rangeOffset != positionNotSpecified;
    599599    ResourceResponse response(firstRequest().url(), m_blobData->contentType(), m_totalRemainingSize, String());
    600     response.setExpectedContentLength(m_totalRemainingSize);
    601600    response.setHTTPStatusCode(isRangeRequest ? httpPartialContent : httpOK);
    602601    response.setHTTPStatusText(isRangeRequest ? httpPartialContentText : httpOKText);
  • trunk/Source/WebCore/platform/network/mac/ResourceResponseMac.mm

    r173272 r173314  
    4646void ResourceResponse::initNSURLResponse() const
    4747{
    48     if (!m_httpStatusCode) {
     48    if (!m_httpStatusCode || !m_url.protocolIsInHTTPFamily()) {
    4949        // Work around a mistake in the NSURLResponse class - <rdar://problem/6875219>.
    5050        // The init function takes an NSInteger, even though the accessor returns a long long.
     
    5656            expectedContentLength = static_cast<NSInteger>(m_expectedContentLength);
    5757
    58         m_nsResponse = adoptNS([[NSURLResponse alloc] initWithURL:m_url MIMEType:m_mimeType expectedContentLength:-1 textEncodingName:m_textEncodingName]);
     58        m_nsResponse = adoptNS([[NSURLResponse alloc] initWithURL:m_url MIMEType:m_mimeType expectedContentLength:expectedContentLength textEncodingName:m_textEncodingName]);
    5959        return;
    6060    }
Note: See TracChangeset for help on using the changeset viewer.