mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 223998
contentAreaUtils.js: getMIMEInfoForExtension should be getTypeFromURI r=neil.parkwaycc.co.uk sr=bz
This commit is contained in:
parent
c4813304a0
commit
590698f777
@ -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) {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user