When sniffing text/plain and we decide it's really text/plain, just claim the sniffer didn't find a type, so that other sniffers get a crack at it. Bug 395533, r+sr=biesi, a=bsmedberg

This commit is contained in:
bzbarsky@mit.edu 2007-09-17 08:53:57 -07:00
parent 819d3d7db0
commit 790d73fc3c

View File

@ -270,7 +270,7 @@ nsUnknownDecoder::GetMIMETypeFromContent(nsIRequest* aRequest,
mBufferLen = 0;
type.Assign(mContentType);
mContentType.Truncate();
return NS_OK;
return type.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK;
}
@ -711,6 +711,10 @@ nsBinaryDetector::DetermineContentType(nsIRequest* aRequest)
if (mContentType.Equals(APPLICATION_OCTET_STREAM)) {
// We want to guess at it instead
mContentType = APPLICATION_GUESS_FROM_EXT;
} else {
// Let the text/plain type we already have be, so that other content
// sniffers can also get a shot at this data.
mContentType.Truncate();
}
}