feat: fix StaticFilter issue

This commit is contained in:
Yang Luo 2023-07-05 17:54:39 +08:00
parent 855259c6e7
commit ba97458edd
2 changed files with 2 additions and 2 deletions

View File

@ -294,7 +294,7 @@ func (c *ApiController) UploadResource() {
return
}
_, applicationId := util.GetOwnerAndNameFromIdNoCheck(strings.TrimRight(fullFilePath, ".html"))
_, applicationId := util.GetOwnerAndNameFromIdNoCheck(strings.TrimSuffix(fullFilePath, ".html"))
applicationObj, err := object.GetApplication(applicationId)
if err != nil {
c.ResponseError(err.Error())

View File

@ -55,7 +55,7 @@ func StaticFilter(ctx *context.Context) {
path += urlPath
}
path2 := strings.TrimLeft(path, "web/build/images/")
path2 := strings.TrimPrefix(path, "web/build/images/")
if util.FileExist(path2) {
makeGzipResponse(ctx.ResponseWriter, ctx.Request, path2)
return