зеркало из https://github.com/mozilla/pjs.git
Bug 223998
contentAreaUtils.js: getMIMEInfoForExtension should be getTypeFromURI r=neil.parkwaycc.co.uk sr=bz
This commit is contained in:
Родитель
6a76c066a3
Коммит
6724968770
|
@ -527,18 +527,9 @@ nsHeaderSniffer.prototype = {
|
|||
if (this.mData.document) {
|
||||
this.contentType = this.mData.document.contentType;
|
||||
} else {
|
||||
try {
|
||||
var url = this.uri.QueryInterface(Components.interfaces.nsIURL);
|
||||
var ext = url.fileExtension;
|
||||
if (ext) {
|
||||
var mimeInfo = getMIMEInfoForExtension(ext);
|
||||
if (mimeInfo)
|
||||
this.contentType = mimeInfo.MIMEType;
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
// Not much we can do here. Give up.
|
||||
}
|
||||
var type = getMIMETypeForURI(this.uri);
|
||||
if (type)
|
||||
this.contentType = type;
|
||||
}
|
||||
}
|
||||
this.mCallback(this, this.mData);
|
||||
|
@ -741,10 +732,10 @@ function getMIMEService()
|
|||
return mimeSvc;
|
||||
}
|
||||
|
||||
function getMIMEInfoForExtension(aExtension)
|
||||
function getMIMETypeForURI(aURI)
|
||||
{
|
||||
try {
|
||||
return getMIMEService().GetFromTypeAndExtension(null, aExtension);
|
||||
return getMIMEService().GetTypeFromURI(aURI);
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче