mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Fix: using url escape instead of unescape in remote handler (#1051)
This commit is contained in:
@@ -153,10 +153,7 @@ func (handler Driver) Put(ctx context.Context, file io.ReadCloser, dst string, s
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 对文件名进行URLEncode
|
// 对文件名进行URLEncode
|
||||||
fileName, err := url.QueryUnescape(path.Base(dst))
|
fileName := url.QueryEscape(path.Base(dst))
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// 决定是否要禁用文件覆盖
|
// 决定是否要禁用文件覆盖
|
||||||
overwrite := "true"
|
overwrite := "true"
|
||||||
@@ -294,7 +291,7 @@ func (handler Driver) Source(
|
|||||||
sourcePath := base64.RawURLEncoding.EncodeToString([]byte(path))
|
sourcePath := base64.RawURLEncoding.EncodeToString([]byte(path))
|
||||||
signedURI, err = auth.SignURI(
|
signedURI, err = auth.SignURI(
|
||||||
handler.AuthInstance,
|
handler.AuthInstance,
|
||||||
fmt.Sprintf("%s/%d/%s/%s", controller, speed, sourcePath, fileName),
|
fmt.Sprintf("%s/%d/%s/%s", controller, speed, sourcePath, url.PathEscape(fileName)),
|
||||||
ttl,
|
ttl,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user