adjust comment about slash position

This commit is contained in:
Erik Krogh Kristensen
2020-08-13 11:33:31 +02:00
parent dc6943b739
commit 3fb9c28806

View File

@@ -69,7 +69,7 @@
doSomeThingWithTrustedURL(x);
}
x.startsWith("https://secure.com/foo/bar"); // OK - the trailing slash makes prefix checks safe.
x.startsWith("https://secure.com/foo/bar"); // OK - a forward slash after the domain makes prefix checks safe.
x.indexOf("https://secure.com/foo/bar") >= 0 // NOT OK - the url can be anywhere in the string.
x.indexOf("https://secure.com") >= 0 // NOT OK
});