diff --git a/cmd/upload/app/handler4.go b/cmd/upload/app/handler4.go index 4954d3d..3d8c7f4 100644 --- a/cmd/upload/app/handler4.go +++ b/cmd/upload/app/handler4.go @@ -63,7 +63,7 @@ func (a *appController) UploadLink(c *fiber.Ctx) error { models.NewResponse(1, "missing path query parameter", nil)) } - if !strings.HasPrefix(path, "/") { + if !strings.HasSuffix(path, "/") { path = path + "/" } if strings.HasPrefix(path, CacheRequestPrefix) { @@ -110,7 +110,7 @@ func (a *appController) UploadedBytes(c *fiber.Ctx) error { models.NewResponse(1, "missing parent_dir query parameter", nil)) } - if !strings.HasPrefix(parentDir, "/") { + if !strings.HasSuffix(parentDir, "/") { parentDir = parentDir + "/" } if strings.HasPrefix(parentDir, CacheRequestPrefix) { @@ -206,7 +206,7 @@ func (a *appController) UploadChunks(c *fiber.Ctx) error { } parentDir := resumableInfo.ParentDir - if !strings.HasPrefix(parentDir, "/") { + if !strings.HasSuffix(parentDir, "/") { parentDir = parentDir + "/" } if strings.HasPrefix(parentDir, CacheRequestPrefix) {