JS: add more tests for js/incomplete-url-substring-sanitization

This commit is contained in:
Esben Sparre Andreasen
2019-01-30 10:37:48 +01:00
parent 321b3f1ab5
commit cfc53ade69
2 changed files with 13 additions and 0 deletions

View File

@@ -51,4 +51,12 @@
x.indexOf("https://example.internal"); // NOT OK
x.indexOf("https://"); // OK
x.startsWith("https://example.internal"); // NOT OK
x.indexOf('https://example.internal.org') !== 0; // NOT OK
x.indexOf('https://example.internal.org') === 0; // NOT OK
x.endsWith("internal.com"); // NOT OK
x.startsWith("https://example.internal:80"); // OK
x.indexOf("secure.com") !== -1; // NOT OK
});