envd-server icon indicating copy to clipboard operation
envd-server copied to clipboard

bug: Image get endpoint doesn't work when image name contains `/`

Open VoVAllen opened this issue 2 years ago • 3 comments

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 👍.

VoVAllen avatar Dec 20 '22 13:12 VoVAllen

I think we have a escape here

/cc @kemingy

gaocegege avatar Dec 20 '22 13:12 gaocegege

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

VoVAllen avatar Dec 20 '22 13:12 VoVAllen

Actually we should use digest, I think.

gaocegege avatar Dec 20 '22 14:12 gaocegege