From f5f4807dcc5dee63da4dd20e77b879a673974308 Mon Sep 17 00:00:00 2001 From: "pchen%netscape.com" Date: Wed, 13 Jun 2001 22:31:08 +0000 Subject: [PATCH] bug 79837, r=pinkerton, sr=alecf, a=asa, don't disable mime matching for Internet Config mappings if we didn't get passed in a file extension git-svn-id: svn://10.0.0.236/trunk@97088 18797224-902f-48f8-a5cc-f745e15eee43 --- .../uriloader/exthandler/mac/nsInternetConfigService.cpp | 7 +++++-- mozilla/xpfe/appshell/src/nsInternetConfigService.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mozilla/uriloader/exthandler/mac/nsInternetConfigService.cpp b/mozilla/uriloader/exthandler/mac/nsInternetConfigService.cpp index 00afab05baf..401cee3d3fc 100644 --- a/mozilla/uriloader/exthandler/mac/nsInternetConfigService.cpp +++ b/mozilla/uriloader/exthandler/mac/nsInternetConfigService.cpp @@ -175,8 +175,11 @@ nsresult nsInternetConfigService::GetMappingForMIMEType(const char *mimetype, co PRBool domimecheck = PR_TRUE, gotmatch = PR_FALSE; ICMapEntry ent; - if ((strcmp(mimetype, UNKNOWN_CONTENT_TYPE) == 0) || - (strcmp(mimetype, APPLICATION_OCTET_STREAM) == 0)) + // if mime type is "unknown" or "octet stream" *AND* we have a file extension, + // then disable match on mime type + if (((nsCRT::strcasecmp(mimetype, UNKNOWN_CONTENT_TYPE) == 0) || + (nsCRT::strcasecmp(mimetype, APPLICATION_OCTET_STREAM) == 0)) && + fileextension) domimecheck = PR_FALSE; entry->totalLength = 0; diff --git a/mozilla/xpfe/appshell/src/nsInternetConfigService.cpp b/mozilla/xpfe/appshell/src/nsInternetConfigService.cpp index 00afab05baf..401cee3d3fc 100644 --- a/mozilla/xpfe/appshell/src/nsInternetConfigService.cpp +++ b/mozilla/xpfe/appshell/src/nsInternetConfigService.cpp @@ -175,8 +175,11 @@ nsresult nsInternetConfigService::GetMappingForMIMEType(const char *mimetype, co PRBool domimecheck = PR_TRUE, gotmatch = PR_FALSE; ICMapEntry ent; - if ((strcmp(mimetype, UNKNOWN_CONTENT_TYPE) == 0) || - (strcmp(mimetype, APPLICATION_OCTET_STREAM) == 0)) + // if mime type is "unknown" or "octet stream" *AND* we have a file extension, + // then disable match on mime type + if (((nsCRT::strcasecmp(mimetype, UNKNOWN_CONTENT_TYPE) == 0) || + (nsCRT::strcasecmp(mimetype, APPLICATION_OCTET_STREAM) == 0)) && + fileextension) domimecheck = PR_FALSE; entry->totalLength = 0;