mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-22 08:27:31 +09:00
Revert "Issue #2258 - Part 1: Support XCTO:nosniff when navigating."
This reverts commit f48c770701e62c382631620f4caa1fdc5ab1d7ae.
This commit is contained in:
parent
73c9c1dd73
commit
0d00c84033
10 changed files with 5 additions and 103 deletions
|
|
@ -66,7 +66,6 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
|
|||
, mForcePreflight(false)
|
||||
, mIsPreflight(false)
|
||||
, mLoadTriggeredFromExternal(false)
|
||||
, mSkipContentSniffing(false)
|
||||
, mIsFromProcessingFrameAttributes(false)
|
||||
{
|
||||
MOZ_ASSERT(mLoadingPrincipal);
|
||||
|
|
@ -242,7 +241,6 @@ LoadInfo::LoadInfo(nsPIDOMWindowOuter* aOuterWindow,
|
|||
, mForcePreflight(false)
|
||||
, mIsPreflight(false)
|
||||
, mLoadTriggeredFromExternal(false)
|
||||
, mSkipContentSniffing(false)
|
||||
, mIsFromProcessingFrameAttributes(false)
|
||||
{
|
||||
// Top-level loads are never third-party
|
||||
|
|
@ -307,7 +305,6 @@ LoadInfo::LoadInfo(const LoadInfo& rhs)
|
|||
, mForcePreflight(rhs.mForcePreflight)
|
||||
, mIsPreflight(rhs.mIsPreflight)
|
||||
, mLoadTriggeredFromExternal(rhs.mLoadTriggeredFromExternal)
|
||||
, mSkipContentSniffing(rhs.mSkipContentSniffing)
|
||||
, mIsFromProcessingFrameAttributes(rhs.mIsFromProcessingFrameAttributes)
|
||||
{
|
||||
}
|
||||
|
|
@ -336,8 +333,7 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
|
|||
const nsTArray<nsCString>& aCorsUnsafeHeaders,
|
||||
bool aForcePreflight,
|
||||
bool aIsPreflight,
|
||||
bool aLoadTriggeredFromExternal,
|
||||
bool aSkipContentSniffing)
|
||||
bool aLoadTriggeredFromExternal)
|
||||
: mLoadingPrincipal(aLoadingPrincipal)
|
||||
, mTriggeringPrincipal(aTriggeringPrincipal)
|
||||
, mPrincipalToInherit(aPrincipalToInherit)
|
||||
|
|
@ -361,7 +357,6 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
|
|||
, mForcePreflight(aForcePreflight)
|
||||
, mIsPreflight(aIsPreflight)
|
||||
, mLoadTriggeredFromExternal(aLoadTriggeredFromExternal)
|
||||
, mSkipContentSniffing(aSkipContentSniffing)
|
||||
, mIsFromProcessingFrameAttributes(false)
|
||||
{
|
||||
// Only top level TYPE_DOCUMENT loads can have a null loadingPrincipal
|
||||
|
|
@ -970,17 +965,6 @@ LoadInfo::MaybeIncreaseTainting(uint32_t aTainting)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LoadInfo::GetSkipContentSniffing(bool* aSkipContentSniffing) {
|
||||
*aSkipContentSniffing = mSkipContentSniffing;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LoadInfo::SetSkipContentSniffing(bool aSkipContentSniffing) {
|
||||
mSkipContentSniffing = aSkipContentSniffing;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
LoadInfo::GetIsTopLevelLoad(bool *aResult)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -111,8 +111,7 @@ private:
|
|||
const nsTArray<nsCString>& aUnsafeHeaders,
|
||||
bool aForcePreflight,
|
||||
bool aIsPreflight,
|
||||
bool aLoadTriggeredFromExternal,
|
||||
bool aSkipContentSniffing);
|
||||
bool aLoadTriggeredFromExternal);
|
||||
LoadInfo(const LoadInfo& rhs);
|
||||
|
||||
friend nsresult
|
||||
|
|
@ -158,7 +157,6 @@ private:
|
|||
bool mForcePreflight;
|
||||
bool mIsPreflight;
|
||||
bool mLoadTriggeredFromExternal;
|
||||
bool mSkipContentSniffing;
|
||||
|
||||
// Is true if this load was triggered by processing the attributes of the
|
||||
// browsing context container.
|
||||
|
|
|
|||
|
|
@ -367,15 +367,6 @@ interface nsILoadInfo : nsISupports
|
|||
*/
|
||||
[infallible] readonly attribute unsigned long securityMode;
|
||||
|
||||
|
||||
/**
|
||||
* This flag is used for any browsing context where we should not sniff
|
||||
* the content type. E.g if an iframe has the XCTO nosniff header, then
|
||||
* that flag is set to true so we skip content sniffing for that browsing
|
||||
* context.
|
||||
*/
|
||||
[infallible] attribute boolean skipContentSniffing;
|
||||
|
||||
/**
|
||||
* True if this request is embedded in a context that can't be third-party
|
||||
* (i.e. an iframe embedded in a cross-origin parent window). If this is
|
||||
|
|
|
|||
|
|
@ -2129,16 +2129,6 @@ 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue