garycourt / uri-js

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

Incorrect resolution with relative paths #31

Closed epoberezkin closed 6 years ago

epoberezkin commented 6 years ago

uri.resolve('../foo/1', '../bar/2') Should result in '../bar/2' (node core package does it) Instead it results in '/bar/2'

garycourt commented 6 years ago

URI.js follows the path resolution rules as defined in RFC 3986. In the spec, the algorithm removes any extra .. from the start of a path. I would recommend using the aforementioned Node package if you need this behavior.