Right now gorilla mux treats /some/url differently than /some/url/. And will route requests for /some/url/ to a handler set up to handle /some/url/{some_resource_id}.
The way the /api/certificate endpoint gets around this is by specifying the route as
r.HandleFunc("/api/{certificate:certificate(?:\\/)?}",.
This is going to get out of hand very quickly if we have to do this for every endpoint.
We should think about doing something like what is suggested here
Right now gorilla mux treats
/some/url
differently than/some/url/
. And will route requests for/some/url/
to a handler set up to handle/some/url/{some_resource_id}
.The way the
/api/certificate
endpoint gets around this is by specifying the route asr.HandleFunc("/api/{certificate:certificate(?:\\/)?}",
.This is going to get out of hand very quickly if we have to do this for every endpoint.
We should think about doing something like what is suggested here
https://husainalshehhi.com/blog/gorilla-mux-trailing-slashes/
Although we may have an edge case for the url "/". We may not want to remove that slash so that the "/" routes will actually work.