Note that the additional s is entirely ignored, since the route does not need to match exactly with the current implementation. It is enough for the route+1 to match. This is likely not intended behaviour and definitely not what i expected to happen.
There is still a "null" and a 200 OK instead of a 404 Not found which i expected, so i investigated further and found another issue.
Since i had
r.GET("/user/{id}", h.handleUserGet)
defined aswell, there actually were children against which the route matched then, since it doesn't care if there is a slash in between or not. So i added a check to verify that there is actually a slash after the matching part of the path.
That finally resulted in
The router matched an additional character on static routes, which is fixed here.
Without this fix, the following happens: let's take this route as an example
some curl against it
Note that the additional
s
is entirely ignored, since the route does not need to match exactly with the current implementation. It is enough for the route+1 to match. This is likely not intended behaviour and definitely not what i expected to happen.This fix provides the following behaviour:
There is still a "null" and a 200 OK instead of a 404 Not found which i expected, so i investigated further and found another issue. Since i had
defined aswell, there actually were children against which the route matched then, since it doesn't care if there is a slash in between or not. So i added a check to verify that there is actually a slash after the matching part of the path. That finally resulted in