envd-server
envd-server copied to clipboard
bug: Image get endpoint doesn't work when image name contains `/`
Description
We used authorized.GET("/:login_name/images/:name", WrapHandler(s.imageGet)) to register the imageGet handler. However, it's common for image name to be nvidia/cuda, which cannot be properly matched with /:name.
Note other restful API may also have similar problems, such as special characters in environment name or username.
cc @gaocegege
Reproduction
Additional Info
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
I think we have a escape here
/cc @kemingy
Not sure what's the best practice here. It's not common to escape / in the URL. Ref: https://stackoverflow.com/questions/48186760/rest-url-parameter-with-slashes#comment83377972_48193355
Actually we should use digest, I think.