route-parser
route-parser copied to clipboard
slash at the end of route
Hey,
Currently when there is a slash at the end of a route, the match function returns false. For example:
routeParser('/test').match('/test/') // false
Is this the expected behavior? Shouldn't the above return a truthful value, since the slash at the end doesn't have a real meaning?
They are technically two different routes, and I believe google would index them as such? I could be wrong though.
@firasdib From what I know, websites will serve the same content if there is or isn't a preceding slash. Just try to add/remove the trailing slash from this issue :).
@omerts Read this https://webmasters.googleblog.com/2010/04/to-slash-or-not-to-slash.html
@firasdib while you are technically right it does seem other routers might treat it (wrongly?) as if it was the same route. I guess a note in the documentation would prevent some surprises.
@goliatone Can confirm a note in the documentation would have prevented me some surprises :)