include startsWith/endsWith checks in js/missing-origin-check

This commit is contained in:
Erik Krogh Kristensen
2022-04-25 15:28:50 +02:00
parent fe3d71ebc2
commit 0a26e891a2
2 changed files with 17 additions and 1 deletions

View File

@@ -61,4 +61,10 @@ function is_valid_origin(origin) {
warn("invalid origin: " + origin);
}
return valid;
}
}
window.onmessage = event => { // OK - the check is OK
if ("https://www.example.com".startsWith(event.origin)) {
// do something
}
}