Revert "Issue #2258 - Part 2: Move XCTO:nosniff check into sniffers."

This reverts commit 51e1650d42b2c033d5d55750b4ea497053524c93.
This commit is contained in:
Moonchild 2025-09-23 18:17:45 +02:00 committed by roytam1
commit 73c9c1dd73
5 changed files with 14 additions and 17 deletions

View file

@ -2129,6 +2129,16 @@ NS_SniffContent(const char *aSnifferType, nsIRequest *aRequest,
const uint8_t *aData, uint32_t aLength,
nsACString &aSniffedType)
{
// In case XCTO nosniff was present, we could just skip sniffing here
nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest);
if (channel) {
nsCOMPtr<nsILoadInfo> loadInfo = channel->GetLoadInfo();
if (loadInfo->GetSkipContentSniffing()) {
aSniffedType.Truncate();
return;
}
}
typedef nsCategoryCache<nsIContentSniffer> ContentSnifferCache;
extern ContentSnifferCache* gNetSniffers;
extern ContentSnifferCache* gDataSniffers;