Skip to content

Commit

Permalink
fix: trim slash suffix of sign
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Sep 11, 2022
1 parent 5ff0d85 commit 6aedd0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/middlewares/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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()
Expand Down

0 comments on commit 6aedd0f

Please sign in to comment.