From 6aedd0f42526aedd85a63cc1e59a9a6de12fb5df Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Sun, 11 Sep 2022 19:39:24 +0800 Subject: [PATCH] fix: trim slash suffix of sign --- server/middlewares/down.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/middlewares/down.go b/server/middlewares/down.go index 4780216c50e..4d00a794cc6 100644 --- a/server/middlewares/down.go +++ b/server/middlewares/down.go @@ -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()