зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1303682 - Add deprecation warning before removing 'referrer' directive from CSP. r=ckerschb
This commit is contained in:
Родитель
ebb9f983f1
Коммит
40e1a53f35
|
@ -77,6 +77,9 @@ ignoringDirectiveWithNoValues = Ignoring ‘%1$S’ since it does not contain an
|
|||
# LOCALIZATION NOTE (ignoringReportOnlyDirective):
|
||||
# %1$S is the directive that is ignored in report-only mode.
|
||||
ignoringReportOnlyDirective = Ignoring sandbox directive when delivered in a report-only policy ‘%1$S’
|
||||
# LOCALIZATION NOTE (deprecatedReferrerDirective):
|
||||
# %1$S is the value of the deprecated Referrer Directive.
|
||||
deprecatedReferrerDirective = Referrer Directive ‘%1$S’ has been deprecated. Please use the Referrer-Policy header instead.
|
||||
|
||||
# CSP Errors:
|
||||
# LOCALIZATION NOTE (couldntParseInvalidSource):
|
||||
|
|
|
@ -865,6 +865,11 @@ nsCSPParser::referrerDirectiveValue(nsCSPDirective* aDir)
|
|||
return;
|
||||
}
|
||||
|
||||
//referrer-directive deprecation warning
|
||||
const char16_t* params[] = { mCurDir[1].get() };
|
||||
logWarningErrorToConsole(nsIScriptError::warningFlag, "deprecatedReferrerDirective",
|
||||
params, ArrayLength(params));
|
||||
|
||||
// the referrer policy is valid, so go ahead and use it.
|
||||
mPolicy->setReferrerPolicy(&mCurDir[1]);
|
||||
mPolicy->addDirective(aDir);
|
||||
|
|
Загрузка…
Ссылка в новой задаче