mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Issue #2258 - Part 1: Support XCTO:nosniff when navigating.
This commit is contained in:
parent
723180132d
commit
e56e5d6cb1
10 changed files with 103 additions and 5 deletions
|
|
@ -14,6 +14,7 @@
|
|||
#include "nsHttp.h"
|
||||
#include "nsHttpChannel.h"
|
||||
#include "nsHttpHandler.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIApplicationCacheService.h"
|
||||
#include "nsIApplicationCacheContainer.h"
|
||||
#include "nsICacheStorageService.h"
|
||||
|
|
@ -1100,6 +1101,16 @@ ProcessXCTO(nsIURI* aURI, nsHttpResponseHead* aResponseHead, nsILoadInfo* aLoadI
|
|||
ReportTypeBlocking(aURI, aLoadInfo, "MimeTypeMismatch");
|
||||
return NS_ERROR_CORRUPTED_CONTENT;
|
||||
}
|
||||
auto policyType = aLoadInfo->GetExternalContentPolicyType();
|
||||
if (policyType == nsIContentPolicy::TYPE_DOCUMENT ||
|
||||
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
|
||||
// NS_SniffContent we then bail early and do not do any sniffing.
|
||||
aLoadInfo->SetSkipContentSniffing(true);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue