Fix #116079 - if a file with no extension is dragged to Mozilla and it has a file type of 'TEXT' treat it as text/plain rather than application/octet-stream. r=bryner, sr=hyatt

This commit is contained in:
sdagley%netscape.com 2002-04-29 07:01:44 +00:00
parent f5ad1d9272
commit 86136e0bf0
2 changed files with 18 additions and 2 deletions

View File

@ -291,7 +291,15 @@ nsresult nsInternetConfigService::FillMIMEInfoForICEntry(ICMapEntry& entry, nsIM
if (entry.MIMEType[0])
info->SetMIMEType(mimetype.get());
else
info->SetMIMEType(APPLICATION_OCTET_STREAM);
{ // The IC mappings seem to not be very agressive about determining the mime type if
// all we have is a type or creator code. This is a bandaid approach for when we
// get a file of type 'TEXT' with no mime type mapping so that we'll display the
// file rather than trying to download it.
if (entry.fileType == 'TEXT')
info->SetMIMEType(TEXT_PLAIN);
else
info->SetMIMEType(APPLICATION_OCTET_STREAM);
}
// convert entry.extension which is a Str255
// don't forget to remove the '.' in front of the file extension....

View File

@ -291,7 +291,15 @@ nsresult nsInternetConfigService::FillMIMEInfoForICEntry(ICMapEntry& entry, nsIM
if (entry.MIMEType[0])
info->SetMIMEType(mimetype.get());
else
info->SetMIMEType(APPLICATION_OCTET_STREAM);
{ // The IC mappings seem to not be very agressive about determining the mime type if
// all we have is a type or creator code. This is a bandaid approach for when we
// get a file of type 'TEXT' with no mime type mapping so that we'll display the
// file rather than trying to download it.
if (entry.fileType == 'TEXT')
info->SetMIMEType(TEXT_PLAIN);
else
info->SetMIMEType(APPLICATION_OCTET_STREAM);
}
// convert entry.extension which is a Str255
// don't forget to remove the '.' in front of the file extension....