Commit 05682d58 authored by Antonio Sartori's avatar Antonio Sartori Committed by Commit Bot

Add validation error messages to network CSP parser

The Content-Security-Policy parser in services/network was silently
ignoring all parsing errors. This is not an issue, since CSPs are
being parsed again in blink, where errors are reported to the
console. However, after we bring CSPEE out-of-blink, the frame csp
attribute will not be parsed in blink anymore, so we will need
validation from the network CSP parser. This change implements it.

Bug: 1094909
Change-Id: I38e572900afcc9a4e55148e206690a16345cd99a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2279976Reviewed-by: default avatarMike West <mkwst@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarArthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Antonio Sartori <antoniosartori@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789412}
parent 06c6a360
......@@ -131,6 +131,7 @@ jumbo_component("cpp") {
deps = [
"//base",
"//base/util/ranges:ranges",
"//components/prefs",
"//ipc",
"//services/proxy_resolver/public/mojom",
......
......@@ -149,6 +149,9 @@ struct ContentSecurityPolicy {
// Set of reporting endpoints to which violation reports are sent.
array<string> report_endpoints;
// An array containing a set of errors occurred while parsing the CSP header.
array<string> parsing_errors;
};
// Data to report Content-Security-Policy violations.
......
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