mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 10:57:34 +09:00
Issue #2258 - Part 2: Move XCTO:nosniff check into sniffers.
This fixes a regression for the JSON viewer from part 1 as it relies on sniffing to prettify (and should carve out the exception even if `nosniff` headers are sent). No real functional changes otherwise. Just catering to a corner case.
This commit is contained in:
parent
e56e5d6cb1
commit
cca20ae131
5 changed files with 17 additions and 14 deletions
|
|
@ -317,9 +317,11 @@ nsUnknownDecoder::GetMIMETypeFromContent(nsIRequest* aRequest,
|
|||
{
|
||||
// Note: This is only used by sniffer, therefore we do not need to lock anything here.
|
||||
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
|
||||
nsCOMPtr<nsILoadInfo> loadInfo = channel->GetLoadInfo();
|
||||
if (loadInfo->GetSkipContentSniffing()) {
|
||||
return NS_OK;
|
||||
if (channel) {
|
||||
nsCOMPtr<nsILoadInfo> loadInfo = channel->GetLoadInfo();
|
||||
if (loadInfo->GetSkipContentSniffing()) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
}
|
||||
mBuffer = const_cast<char*>(reinterpret_cast<const char*>(aData));
|
||||
mBufferLen = aLength;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue