Commit f4a9a31e authored by Daniel Vogelheim's avatar Daniel Vogelheim Committed by Commit Bot

[Trusted Types] Fix Trusted Types experiment check.

The current code (erroneously) checks for the 'experimental CSP features'
flag when processing Trusted Type related CSP directives, while the
majority of TT checks TrustedDOMTypes enabled/disabled. This patch
removes the extra check.

(This was introduced erroneously in crrev.com/c/1993351, when reworking
the TT CSP directives.)

Bug: 1054387
Change-Id: Iad04f0f80b30874c61e5819b6319b85358bd4631
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066545
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: default avatarMike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743461}
parent 18919605
......@@ -1366,16 +1366,16 @@ void CSPDirectiveList::AddDirective(const String& name, const String& value) {
} else if (type == ContentSecurityPolicy::DirectiveType::kReportTo &&
base::FeatureList::IsEnabled(network::features::kReporting)) {
ParseReportTo(name, value);
} else if (policy_->ExperimentalFeaturesEnabled()) {
if (type == ContentSecurityPolicy::DirectiveType::kRequireSRIFor) {
ParseRequireSRIFor(name, value);
} else if (type == ContentSecurityPolicy::DirectiveType::kPrefetchSrc) {
SetCSPDirective<SourceListDirective>(name, value, prefetch_src_);
} else if (type == ContentSecurityPolicy::DirectiveType::kTrustedTypes) {
AddTrustedTypes(name, value);
} else if (type ==
ContentSecurityPolicy::DirectiveType::kRequireTrustedTypesFor) {
RequireTrustedTypesFor(name, value);
} else if (policy_->ExperimentalFeaturesEnabled()) {
if (type == ContentSecurityPolicy::DirectiveType::kRequireSRIFor) {
ParseRequireSRIFor(name, value);
} else if (type == ContentSecurityPolicy::DirectiveType::kPrefetchSrc) {
SetCSPDirective<SourceListDirective>(name, value, prefetch_src_);
} else {
policy_->ReportUnsupportedDirective(name);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment