diff --git a/go_cloud/internal/http/routes.go b/go_cloud/internal/http/routes.go index fd35d68..7eb7189 100644 --- a/go_cloud/internal/http/routes.go +++ b/go_cloud/internal/http/routes.go @@ -3255,8 +3255,8 @@ func publicFileDownloadHandler(w http.ResponseWriter, r *http.Request, db *datab // Create zip entry - use relative path within the folder relativePath := strings.TrimPrefix(fileToZip.Path, file.Path) - if strings.HasPrefix(relativePath, "/") { - relativePath = strings.TrimPrefix(relativePath, "/") + if after, ok := strings.CutPrefix(relativePath, "/"); ok { + relativePath = after } zipFile, err := zipWriter.Create(relativePath)