bug 223997

PluginHostImpl should use GetTypeFromURI not FromExtension
r=peterlubczynski sr=bz
This commit is contained in:
cbiesinger%web.de 2003-11-08 17:01:46 +00:00
parent adbe194656
commit e3dd841394

View File

@ -3960,22 +3960,13 @@ nsresult nsPluginHostImpl::SetUpDefaultPluginInstance(const char *aMimeType, nsI
if(mimetype == nsnull)
{
nsresult res = NS_OK;
nsCOMPtr<nsIURL> url = do_QueryInterface(aURL);
if(url)
nsCOMPtr<nsIMIMEService> ms (do_GetService(NS_MIMESERVICE_CONTRACTID, &res));
if(NS_SUCCEEDED(res))
{
nsCAutoString extension;
url->GetFileExtension(extension);
if(!extension.IsEmpty())
{
nsCOMPtr<nsIMIMEService> ms (do_GetService(NS_MIMESERVICE_CONTRACTID, &res));
if(NS_SUCCEEDED(res) && ms)
{
res = ms->GetTypeFromExtension(extension.get(), getter_Copies(mt));
if(NS_SUCCEEDED(res))
mimetype = mt;
}
}
nsXPIDLCString mt;
res = ms->GetTypeFromURI(aURL, getter_Copies(mt));
if(NS_SUCCEEDED(res))
mimetype = mt;
}
}