feat: standardize Resource APIs by handling path prefix internally and returning clean paths (#4047)

This commit is contained in:
IsAurora6
2025-08-08 23:31:22 +08:00
committed by GitHub
parent f5b4cd7fab
commit 49d734d249
2 changed files with 9 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import (
"fmt"
"io"
"mime"
"path"
"path/filepath"
"strings"
@@ -187,6 +188,11 @@ func (c *ApiController) DeleteResource() {
}
_, resource.Name = refineFullFilePath(resource.Name)
tag := c.Input().Get("tag")
if tag == "Direct" {
resource.Name = path.Join(provider.PathPrefix, resource.Name)
}
err = object.DeleteFile(provider, resource.Name, c.GetAcceptLanguage())
if err != nil {
c.ResponseError(err.Error())