fix!: sign with the raw path instead of filename (#2258)

This commit is contained in:
Gerhard Tan
2022-11-11 16:24:25 +08:00
committed by GitHub
parent 1743110a70
commit 00de9bf16d
6 changed files with 15 additions and 16 deletions

View File

@ -3,11 +3,12 @@ package common
import (
"github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/sign"
stdpath "path"
)
func Sign(obj model.Obj, encrypt bool) string {
func Sign(obj model.Obj, parent string, encrypt bool) string {
if obj.IsDir() || !encrypt {
return ""
}
return sign.Sign(obj.GetName())
return sign.Sign(stdpath.Join(parent, obj.GetName()))
}