REGRESSION (r173356): Safari can't install a profile, gets 'Download Failed error
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Oct 2014 22:54:14 +0000 (22:54 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Oct 2014 22:54:14 +0000 (22:54 +0000)
commitbcded9a3b047a6429790d345c08ca705db4a447d
treea94478ae3653ca4169cd19bbe64a3f232b58ff95
parent6e083b0ac0abc79c2a8e2706d3e08fb32519b089
REGRESSION (r173356): Safari can't install a profile, gets 'Download Failed error
https://bugs.webkit.org/show_bug.cgi?id=137855

Reviewed by Dan Bernstein.

Source/WebCore:

We lose the sniffed MIME type for the response when synthesizing an NSURLResponse. Sniffing requires
backchannel data that the synthesized response doesn't have.

Test: http/tests/mime/mime-type-sniff.html

* platform/network/mac/ResourceResponseMac.mm:
(WebCore::ResourceResponse::initNSURLResponse):

    When synthesizing NSURLResponse explicitly set the Content-type header to the sniffed type.

Tools:

Test and warn if the dumped response mime type differs from the platform response mime type.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didReceiveResponseForResource):
(WTR::InjectedBundlePage::platformResponseMimeType):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
* WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm:
(WTR::InjectedBundlePage::platformResponseMimeType):

LayoutTests:

* http/tests/mime/mime-type-sniff-expected.txt: Added.
* http/tests/mime/mime-type-sniff.html: Added.
* http/tests/mime/resources/png-with-text-content-type.cgi: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174866 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/mime/mime-type-sniff-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/mime/mime-type-sniff.html [new file with mode: 0644]
LayoutTests/http/tests/mime/resources/png-with-text-content-type.cgi [new file with mode: 0755]
Source/WebCore/ChangeLog
Source/WebCore/platform/network/mac/ResourceResponseMac.mm
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
Tools/WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm