mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
Issue #2728 - Remove obsolete CSP referrer policy.
This has been superseded by the dedicated Referrer-policy header. Resolves #2728
This commit is contained in:
parent
d7f01911b8
commit
0331e633bd
16 changed files with 14 additions and 606 deletions
|
|
@ -1235,7 +1235,7 @@ nsCSPDirective::toDomCSPStruct(mozilla::dom::CSP& outCSP) const
|
|||
outCSP.mScript_src_attr.Value() = mozilla::Move(srcs);
|
||||
return;
|
||||
|
||||
// REFERRER_DIRECTIVE and REQUIRE_SRI_FOR are handled in nsCSPPolicy::toDomCSPStruct()
|
||||
// REQUIRE_SRI_FOR is handled in nsCSPPolicy::toDomCSPStruct()
|
||||
|
||||
default:
|
||||
NS_ASSERTION(false, "cannot find directive to convert CSP to JSON");
|
||||
|
|
@ -1581,14 +1581,7 @@ nsCSPPolicy::toString(nsAString& outStr) const
|
|||
{
|
||||
uint32_t length = mDirectives.Length();
|
||||
for (uint32_t i = 0; i < length; ++i) {
|
||||
|
||||
if (mDirectives[i]->equals(nsIContentSecurityPolicy::REFERRER_DIRECTIVE)) {
|
||||
outStr.AppendASCII(CSP_CSPDirectiveToString(nsIContentSecurityPolicy::REFERRER_DIRECTIVE));
|
||||
outStr.AppendASCII(" ");
|
||||
outStr.Append(mReferrerPolicy);
|
||||
} else {
|
||||
mDirectives[i]->toString(outStr);
|
||||
}
|
||||
mDirectives[i]->toString(outStr);
|
||||
if (i != (length - 1)) {
|
||||
outStr.AppendASCII("; ");
|
||||
}
|
||||
|
|
@ -1601,14 +1594,7 @@ nsCSPPolicy::toDomCSPStruct(mozilla::dom::CSP& outCSP) const
|
|||
outCSP.mReport_only = mReportOnly;
|
||||
|
||||
for (uint32_t i = 0; i < mDirectives.Length(); ++i) {
|
||||
if (mDirectives[i]->equals(nsIContentSecurityPolicy::REFERRER_DIRECTIVE)) {
|
||||
mozilla::dom::Sequence<nsString> srcs;
|
||||
srcs.AppendElement(mReferrerPolicy, mozilla::fallible);
|
||||
outCSP.mReferrer.Construct();
|
||||
outCSP.mReferrer.Value() = srcs;
|
||||
} else {
|
||||
mDirectives[i]->toDomCSPStruct(outCSP);
|
||||
}
|
||||
mDirectives[i]->toDomCSPStruct(outCSP);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue