WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2008 21:30:48 +0000 (21:30 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2008 21:30:48 +0000 (21:30 +0000)
commitd7e291765d2f27b156ef18538cf9cd352a000d55
tree2666cbd6a1b9135834fa45d8dfbe2b85b9fb468b
parent7f246dfa98654e5faea58c7905503db15ab93252
WebCore:

        Reviewed by Alexey Proskuryakov.

        - WebCore part of fixing http://bugs.webkit.org/show_bug.cgi?id=17360
          <rdar://problem/5743131> REGRESSION: mp4 file downloaded from server is downloaded as html

        Test: http/tests/loading/text-content-type-with-binary-extension.html

        Refined the workaround for <rdar://problem/5321972> to exclude files
        with extensions that are known to be associated with binary MIME types.

        * WebCore.xcodeproj/project.pbxproj: Added WebCoreURLResponse.{h,mm}.
        * platform/network/mac/ResourceResponseMac.mm:
        (WebCore::ResourceResponse::doUpdateResourceResponse): Moved the
        workaround logic into WebCoreURLResponse.
        * platform/network/mac/WebCoreURLResponse.h: Added.
        * platform/network/mac/WebCoreURLResponse.mm: Added.
        (createBinaryExtensionsSet): Returns a set of extensions known to
        belong to MIME types of binary data.
        (-[NSURLResponse _webcore_MIMEType]):
        (-[NSHTTPURLResponse _webcore_MIMEType]): Forces the MIME type from
        application/octet-stream to text/plain if that is the specified
        Content-Type, unless the extension is in the binary extensions set.

WebKit/mac:

        Reviewed by Alexey Proskuryakov.

        - WebKit part of fixing http://bugs.webkit.org/show_bug.cgi?id=17360
          <rdar://problem/5743131> REGRESSION: mp4 file downloaded from server is downloaded as html

        * WebView/WebDataSource.mm:
        (+[WebDataSource _representationClassForMIMEType:]):
        (-[WebDataSource _responseMIMEType]):
        (-[WebDataSource subresources]):
        (-[WebDataSource subresourceForURL:]):
        * WebView/WebResource.mm:
        (-[WebResource _initWithData:URL:response:]):
        * WebView/WebResourcePrivate.h:

LayoutTests:

        Reviewed by Alexey Proskuryakov.

        - test for http://bugs.webkit.org/show_bug.cgi?id=17360
          <rdar://problem/5743131> REGRESSION: mp4 file downloaded from server is downloaded as html

        * http/tests/loading/resources/.htaccess: Added.
        * http/tests/loading/resources/binaryData.m4a: Added.
        * http/tests/loading/text-content-type-with-binary-extension-expected.txt: Added.
        * http/tests/loading/text-content-type-with-binary-extension.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/loading/resources/.htaccess [new file with mode: 0644]
LayoutTests/http/tests/loading/resources/binaryData.m4a [new file with mode: 0644]
LayoutTests/http/tests/loading/text-content-type-with-binary-extension-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/loading/text-content-type-with-binary-extension.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/platform/network/mac/ResourceResponseMac.mm
WebCore/platform/network/mac/WebCoreURLResponse.h [new file with mode: 0644]
WebCore/platform/network/mac/WebCoreURLResponse.mm [new file with mode: 0644]
WebKit/mac/ChangeLog
WebKit/mac/WebView/WebDataSource.mm
WebKit/mac/WebView/WebResource.mm
WebKit/mac/WebView/WebResourcePrivate.h