garycourt / uri-js

An RFC 3986 compliant, scheme extendable URI parsing/validating/normalizing/resolving library for JavaScript
Other
305 stars 69 forks source link

Invalid scheme syntax permitted #35

Closed palemieux closed 4 years ago

palemieux commented 6 years ago

urijs.parse("any(http://www.w3.org/ns/ttml/profile/ttml2-transformation")

does not result in an error, even though the scheme component of an absolute URI is constrained to ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) per RFC 3986, and the path-noscheme of a relative URI cannot contain a ":" until after the first "/".

garycourt commented 4 years ago

The reason you are not seeing an error here is because URI.js does not perform validation on a parsed URI. Instead, it will try and parse the URI as permissively as it can. URI validation is not currently supported by this library.