fix: trim slash suffix of sign

pull/1831/head v3.0.0-beta.2
Noah Hsu 2022-09-11 19:39:24 +08:00
parent 5ff0d850d7
commit 6aedd0f425
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package middlewares
import (
stdpath "path"
"strings"
"github.com/alist-org/alist/v3/internal/db"
"github.com/alist-org/alist/v3/internal/errs"
@ -28,7 +29,7 @@ func Down(c *gin.Context) {
// verify sign
if needSign(meta, rawPath) {
s := c.Query("sign")
err = sign.Verify(filename, s)
err = sign.Verify(filename, strings.TrimSuffix(s, "/"))
if err != nil {
common.ErrorResp(c, err, 401)
c.Abort()