From 05ff7908f21b39a1c557b9c36b1eb28e5bc3af69 Mon Sep 17 00:00:00 2001 From: Seven <53081179+Seven66677731@users.noreply.github.com> Date: Sat, 2 Aug 2025 00:23:18 +0800 Subject: [PATCH] fix(strm): encoded path is ineffective (#951) --- drivers/strm/util.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/strm/util.go b/drivers/strm/util.go index 4b77eec7..73a5e103 100644 --- a/drivers/strm/util.go +++ b/drivers/strm/util.go @@ -127,20 +127,16 @@ func (d *Strm) list(ctx context.Context, dst, sub string, args *fs.ListArgs) ([] } func (d *Strm) getLink(ctx context.Context, path string) string { - var encodePath string + finalPath := path if d.EncodePath { - encodePath = utils.EncodePath(path, true) + finalPath = utils.EncodePath(path, true) } if d.EnableSign { signPath := sign.Sign(path) - if len(encodePath) > 0 { - path = fmt.Sprintf("%s?sign=%s", encodePath, signPath) - } else { - path = fmt.Sprintf("%s?sign=%s", path, signPath) - } + finalPath = fmt.Sprintf("%s?sign=%s", finalPath, signPath) } if d.LocalModel { - return path + return finalPath } apiUrl := d.SiteUrl if len(apiUrl) > 0 { @@ -151,5 +147,5 @@ func (d *Strm) getLink(ctx context.Context, path string) string { return fmt.Sprintf("%s/d%s", apiUrl, - path) + finalPath) }