We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecfec13 commit e7571cdCopy full SHA for e7571cd
handler/image.go
@@ -210,6 +210,7 @@ func (i image) UploadImage(c *fiber.Ctx) error {
210
objectName := imageName
211
if path != "" {
212
// Sanitize path as well
213
+ path = strings.Trim(path, "/")
214
sanitizedPath := service.SanitizeObjectName(path)
215
objectName = sanitizedPath + "/" + imageName
216
}
@@ -361,6 +362,7 @@ func (i image) UploadWithUrl(c *fiber.Ctx) error {
361
362
objectName := randomName + "." + sanitizedExtension
363
if req.Path != "" {
364
365
+ req.Path = strings.Trim(req.Path, "/")
366
sanitizedPath := service.SanitizeObjectName(req.Path)
367
objectName = sanitizedPath + "/" + randomName + "." + sanitizedExtension
368
0 commit comments