From b7ac62d47ef47a700920390ac665d1161ad09de0 Mon Sep 17 00:00:00 2001 From: "rpotts%netscape.com" Date: Sun, 27 Jan 2002 06:03:39 +0000 Subject: [PATCH] bug #120590 (r=mscott@netscape.com, sr=darin@netscape.com). HTTP was using the wrong mime handler... --- netwerk/build/nsNetModule.cpp | 5 ----- netwerk/protocol/http/src/nsHttpHandler.cpp | 3 +-- netwerk/protocol/http/src/nsHttpResponseHead.cpp | 4 +++- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/netwerk/build/nsNetModule.cpp b/netwerk/build/nsNetModule.cpp index f13a0066b72c..c1949a37404a 100644 --- a/netwerk/build/nsNetModule.cpp +++ b/netwerk/build/nsNetModule.cpp @@ -872,11 +872,6 @@ static nsModuleComponentInfo gNetModuleInfo[] = { { "Cache Manager",NS_CACHE_MANAGER_CID, NS_NETWORK_CACHE_MANAGER_CONTRACTID,nsCacheManagerConstructor }, #endif // from netwerk/mime: - { "The MIME mapping service", - NS_MIMESERVICE_CID, - "@mozilla.org/mimeold;1", - nsMIMEService::Create - }, { "xml mime datasource", NS_XMLMIMEDATASOURCE_CID, NS_XMLMIMEDATASOURCE_CONTRACTID, diff --git a/netwerk/protocol/http/src/nsHttpHandler.cpp b/netwerk/protocol/http/src/nsHttpHandler.cpp index fa31854f0488..7b92f73b61b4 100644 --- a/netwerk/protocol/http/src/nsHttpHandler.cpp +++ b/netwerk/protocol/http/src/nsHttpHandler.cpp @@ -76,7 +76,6 @@ static NS_DEFINE_CID(kNetModuleMgrCID, NS_NETMODULEMGR_CID); static NS_DEFINE_CID(kStreamConverterServiceCID, NS_STREAMCONVERTERSERVICE_CID); static NS_DEFINE_CID(kCacheServiceCID, NS_CACHESERVICE_CID); static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); -static NS_DEFINE_CID(kMimeServiceCID, NS_MIMESERVICE_CID); #define UA_PREF_PREFIX "general.useragent." #define UA_APPNAME "Mozilla" @@ -565,7 +564,7 @@ nsHttpHandler::GetMimeService(nsIMIMEService **result) { if (!mMimeService) { nsresult rv; - mMimeService = do_GetService(kMimeServiceCID, &rv); + mMimeService = do_GetService("@mozilla.org/mime;1", &rv); if (NS_FAILED(rv)) return rv; } *result = mMimeService; diff --git a/netwerk/protocol/http/src/nsHttpResponseHead.cpp b/netwerk/protocol/http/src/nsHttpResponseHead.cpp index 65cbed8fc76d..eada1612bec3 100644 --- a/netwerk/protocol/http/src/nsHttpResponseHead.cpp +++ b/netwerk/protocol/http/src/nsHttpResponseHead.cpp @@ -591,7 +591,9 @@ nsHttpResponseHead::ParseContentType(char *type) while (--p >= type) *p = nsCRT::ToLower(*p); - mContentType = nsCRT::strdup(type); + // If the server sent "*/*", it is meaningless, so do not store it. + if (PL_strcmp(type, "*/*")) + mContentType = nsCRT::strdup(type); } void