зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1362318 - Part2: Fallback override MIME type to application/octet-stream, r=baku
Set override MIME type to 'application/octet-stream', if type is not a parsable MIME type.
This commit is contained in:
Родитель
c5dd1dadc2
Коммит
0deb22583d
|
@ -1972,6 +1972,13 @@ XMLHttpRequestMainThread::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
|
|||
channel->SetContentType(NS_ConvertUTF16toUTF8(mOverrideMimeType));
|
||||
}
|
||||
|
||||
// Fallback to 'application/octet-stream'
|
||||
nsAutoCString type;
|
||||
channel->GetContentType(type);
|
||||
if (type.Equals(UNKNOWN_CONTENT_TYPE)) {
|
||||
channel->SetContentType(NS_LITERAL_CSTRING(APPLICATION_OCTET_STREAM));
|
||||
}
|
||||
|
||||
DetectCharset();
|
||||
|
||||
// Set up arraybuffer
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
[overridemimetype-blob.html]
|
||||
type: testharness
|
||||
[Bogus MIME type should end up as application/octet-stream]
|
||||
expected: FAIL
|
||||
|
||||
[Bogus MIME type should end up as application/octet-stream, 2]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче