Bug 223998

contentAreaUtils.js: getMIMEInfoForExtension should be getTypeFromURI
r=neil.parkwaycc.co.uk sr=bz
This commit is contained in:
cbiesinger%web.de 2003-10-30 21:34:39 +00:00
parent c4813304a0
commit 590698f777

View File

@ -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) {
}