LibWeb: Parse the correct header list for CSP-Report-Only

Fixes a regression from a copy-paste mistake in commit:
ed27eea091

The regressed CSP tests aren't able to be imported, unfortunately. They
do not work with the file-based test-web infra.
This commit is contained in:
Timothy Flynn 2025-11-26 19:14:56 -05:00 committed by Tim Flynn
parent 693dd7b6f6
commit 00070455fd
Notes: github-actions[bot] 2025-11-27 02:23:51 +00:00

View file

@ -118,7 +118,7 @@ GC::Ref<PolicyList> Policy::parse_a_responses_content_security_policies(GC::Heap
// responses header list:
auto report_policy_tokens_or_failure = response->header_list()->extract_header_list_values("Content-Security-Policy-Report-Only"sv);
if (auto const* report_policy_tokens = enforce_policy_tokens_or_failure.get_pointer<Vector<ByteString>>()) {
if (auto const* report_policy_tokens = report_policy_tokens_or_failure.get_pointer<Vector<ByteString>>()) {
for (auto const& report_policy_token : *report_policy_tokens) {
// 1. Let policy be the result of parsing token, with a source of "header", and a disposition of "report".
auto policy = parse_a_serialized_csp(heap, report_policy_token, Policy::Source::Header, Policy::Disposition::Report);