fix: missed encode path while use down proxy (close #2208)

pull/2258/head
Noah Hsu 2022-11-06 14:46:47 +08:00
parent 18cd45d257
commit 26a29f20c3
1 changed files with 4 additions and 1 deletions

View File

@ -272,7 +272,10 @@ func FsGet(c *gin.Context) {
} }
if storage.Config().MustProxy() || storage.GetStorage().WebProxy { if storage.Config().MustProxy() || storage.GetStorage().WebProxy {
if storage.GetStorage().DownProxyUrl != "" { if storage.GetStorage().DownProxyUrl != "" {
rawURL = fmt.Sprintf("%s%s?sign=%s", strings.Split(storage.GetStorage().DownProxyUrl, "\n")[0], req.Path, sign.Sign(obj.GetName())) rawURL = fmt.Sprintf("%s%s?sign=%s",
strings.Split(storage.GetStorage().DownProxyUrl, "\n")[0],
utils.EncodePath(req.Path, true),
sign.Sign(obj.GetName()))
} else { } else {
rawURL = fmt.Sprintf("%s/p%s?sign=%s", rawURL = fmt.Sprintf("%s/p%s?sign=%s",
common.GetApiUrl(c.Request), common.GetApiUrl(c.Request),