This commit is contained in:
Daniel 2024-12-24 16:33:24 +08:00
parent 78d5f54117
commit d34caba3bb
No known key found for this signature in database
GPG Key ID: 86211BA83DF03017
2 changed files with 6 additions and 0 deletions

View File

@ -57,6 +57,9 @@ func statAsset(c *gin.Context) {
if strings.Contains(p, ":") {
p = strings.TrimPrefix(p, "/")
}
if strings.Contains(p, "?") {
p = p[:strings.Index(p, "?")]
}
} else {
ret.Code = 1
return

View File

@ -116,6 +116,9 @@ func NetAssets2LocalAssets(rootID string, onlyImg bool, originalURL string) (err
if strings.Contains(u, ":") {
u = strings.TrimPrefix(u, "/")
}
if strings.Contains(u, "?") {
u = u[:strings.Index(u, "?")]
}
if !gulu.File.IsExist(u) || gulu.File.IsDir(u) {
continue