very temporary gross necko hack to force an text/html content type in the file and http protocols

git-svn-id: svn://10.0.0.236/trunk@37494 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
valeski%netscape.com 1999-06-29 23:28:15 +00:00
parent 00f19d472d
commit 9342bd261d
2 changed files with 25 additions and 2 deletions

View File

@ -34,6 +34,7 @@
#include "nsISimpleEnumerator.h"
#include "nsIURL.h"
#include "prio.h"
#include "prmem.h" // XXX can be removed when we start doing real content-type discovery
static NS_DEFINE_CID(kEventQueueService, NS_EVENTQUEUESERVICE_CID);
NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
@ -438,10 +439,20 @@ nsFileChannel::SetLoadAttributes(PRUint32 aLoadAttributes)
return NS_OK;
}
#define DUMMY_TYPE "text/html"
NS_IMETHODIMP
nsFileChannel::GetContentType(char * *aContentType)
{
return NS_ERROR_NOT_IMPLEMENTED;
// XXX temporary hack until we have a contenttype strategy
*aContentType = new char[PL_strlen(DUMMY_TYPE) + 1];
if (!*aContentType)
return NS_ERROR_OUT_OF_MEMORY;
PL_strcpy(*aContentType, DUMMY_TYPE);
return NS_OK;
//return NS_ERROR_NOT_IMPLEMENTED;
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -25,6 +25,7 @@
#include "nsIChannel.h"
#include "nsIInputStream.h"
#include "nsIStreamListener.h"
#include "prmem.h" // XXX can be removed when we start doing real content-type discovery
#include "nsIHttpNotify.h"
#include "nsINetModRegEntry.h"
@ -210,10 +211,21 @@ nsHTTPChannel::SetLoadAttributes(PRUint32 aLoadAttributes)
return NS_OK;
}
#define DUMMY_TYPE "text/html"
NS_IMETHODIMP
nsHTTPChannel::GetContentType(char * *aContentType)
{
return NS_ERROR_NOT_IMPLEMENTED;
// XXX temporary hack until we have a contenttype strategy
*aContentType = new char[PL_strlen(DUMMY_TYPE) + 1];
if (!*aContentType)
return NS_ERROR_OUT_OF_MEMORY;
PL_strcpy(*aContentType, DUMMY_TYPE);
return NS_OK;
//return NS_ERROR_NOT_IMPLEMENTED;
}
////////////////////////////////////////////////////////////////////////////////