Add warning for reporting CSP violations (#38181)

This should help debug cases like #38180

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe 2025-07-20 18:06:04 +02:00 committed by GitHub
parent b8a6600e9a
commit e24acc5fe5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,6 +16,7 @@ use content_security_policy::{
use http::header::{HeaderMap, HeaderValue, ValueIter};
use hyper_serde::Serde;
use js::rust::describe_scripted_caller;
use log::warn;
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use crate::dom::bindings::inheritance::Castable;
@ -251,6 +252,7 @@ impl GlobalCspReporting for GlobalScope {
if violations.is_empty() {
return;
}
warn!("Reporting CSP violations: {:?}", violations);
let source_position =
source_position.unwrap_or_else(compute_scripted_caller_source_position);
for violation in violations {