chore: Add test for synthesized image documents with CSP headers. (#38191)

Adds a regression test for https://github.com/servo/servo/pull/38186,
verifying that the CSP header on the image is ignored when it's loaded
as a document.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-07-28 09:45:54 -04:00 committed by GitHub
parent a67998b520
commit 02297791c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 40 additions and 0 deletions

View file

@ -39126,6 +39126,23 @@
] ]
] ]
}, },
"content-security-policy": {
"generic": {
"image-document-ignores-csp.html": [
"a3f6f64854d98d40c8c405831d6f3f9656fdf34d",
[
null,
[
[
"/content-security-policy/generic/image-document-ignores-csp-ref.html",
"=="
]
],
{}
]
]
}
},
"contenteditable": { "contenteditable": {
"synthetic-height.html": [ "synthetic-height.html": [
"4d466bff412e6de924b9886ef808b49f7ff2b44d", "4d466bff412e6de924b9886ef808b49f7ff2b44d",
@ -401739,6 +401756,10 @@
"5c580273dcfc94eff137a0ae65314bebc9b7b5c0", "5c580273dcfc94eff137a0ae65314bebc9b7b5c0",
[] []
], ],
"image-document-ignores-csp-ref.html": [
"e0747fd6c2810ccd771c5e33795d8c46ba56ff6c",
[]
],
"negativeTests.js": [ "negativeTests.js": [
"44b4d7f683d8fb674a3c2b5d22eb8ea9d7b31ada", "44b4d7f683d8fb674a3c2b5d22eb8ea9d7b31ada",
[] []
@ -402755,6 +402776,14 @@
"2fa1e0ac0663a65deae6602621521cc2844b93de", "2fa1e0ac0663a65deae6602621521cc2844b93de",
[] []
], ],
"pass3.png": [
"2fa1e0ac0663a65deae6602621521cc2844b93de",
[]
],
"pass3.png.headers": [
"6581fd425ed9da6b6273d1eefb84ea9ac9ac6e53",
[]
],
"ping.js": [ "ping.js": [
"750ae45f969491ea29eaa47c85f96f97d94b415f", "750ae45f969491ea29eaa47c85f96f97d94b415f",
[] []

View file

@ -0,0 +1,3 @@
<!doctype html>
<meta charset="utf-8">
<iframe src="../support/pass.png">

View file

@ -0,0 +1,7 @@
<!doctype html>
<meta charset="utf-8">
<title>CSP header ignored for image document</title>
<link rel="help" href="https://github.com/servo/servo/issues/38180">
<link rel='match' href='image-document-ignores-csp-ref.html'>
<link rel="author" title="Josh Matthews" href="mailto:josh@joshmatthews.net">
<iframe src="../support/pass3.png">

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -0,0 +1 @@
Content-Security-Policy: default-src 'none'