bug 91726, r=pinkerton, sr=sfraser, under carbon, Internet Config seems to return mappings with a null mime type string, if we see a null mime type string, set mime type in nsMimeInfo to octet-stream

This commit is contained in:
pchen%netscape.com 2001-08-22 00:19:08 +00:00
Родитель ef499d7d29
Коммит df074c3f00
2 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -271,7 +271,11 @@ nsresult nsInternetConfigService::FillMIMEInfoForICEntry(ICMapEntry& entry, nsIM
if (info)
{
nsCAutoString mimetype ((char *)&entry.MIMEType[1], entry.MIMEType[0]);
info->SetMIMEType(mimetype.get());
// check if entry.MIMEType is empty, if so, set mime type to APPLICATION_OCTET_STREAM
if (entry.MIMEType[0])
info->SetMIMEType(mimetype.get());
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....

Просмотреть файл

@ -271,7 +271,11 @@ nsresult nsInternetConfigService::FillMIMEInfoForICEntry(ICMapEntry& entry, nsIM
if (info)
{
nsCAutoString mimetype ((char *)&entry.MIMEType[1], entry.MIMEType[0]);
info->SetMIMEType(mimetype.get());
// check if entry.MIMEType is empty, if so, set mime type to APPLICATION_OCTET_STREAM
if (entry.MIMEType[0])
info->SetMIMEType(mimetype.get());
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....