Skip to content

Commit 3f0a628

Browse files
authored
Add URL filter to the securitypolicyviolation event handler (#13570)
* Add URL filter to the securitypolicyviolation event handler * Fix formatting
1 parent b3192b8 commit 3f0a628

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/dev/core/src/Misc/fileTools.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ export const LoadImage = (
254254
};
255255

256256
const cspHandler = (err: any) => {
257+
if (err.blockedURI !== img.src) {
258+
return;
259+
}
260+
257261
unloadHandlersList();
258262
const cspException = new Error(`CSP violation of policy ${err.effectiveDirective} ${err.blockedURI}. Current policy is ${err.originalPolicy}`);
259263

0 commit comments

Comments
 (0)