mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
Issue #2258 - Part 3: Allow sniffing with XCTO:nosniff + empty MIME type.
This moves the checking code back to NS_SniffContent and specifically checks requests for either: - Empty `Content-type` header, OR - A known JSON MIME type If present, sniffing is allowed despite `nosniff` because in the first case this is webmaster error (conflicting `nosniff` without MIME type would always fail, so sniff it), and in the second case we need this carveout or our json viewer will break.
This commit is contained in:
parent
cca20ae131
commit
707c3e3fa8
5 changed files with 31 additions and 35 deletions
|
|
@ -1106,7 +1106,7 @@ ProcessXCTO(nsIURI* aURI, nsHttpResponseHead* aResponseHead, nsILoadInfo* aLoadI
|
|||
policyType == nsIContentPolicy::TYPE_SUBDOCUMENT) {
|
||||
// If the header XCTO nosniff is set for any browsing context, then
|
||||
// we set the skipContentSniffing flag on the Loadinfo. Within
|
||||
// GetMIMETypeFromContent we then bail early and do not do any sniffing.
|
||||
// NS_SniffContent we then bail early and do not do any sniffing.
|
||||
aLoadInfo->SetSkipContentSniffing(true);
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue