Fix: using url escape instead of unescape in remote handler (#1051)
This commit is contained in:
parent
7fd984f95d
commit
700e13384e
1 changed files with 2 additions and 5 deletions
|
@ -153,10 +153,7 @@ func (handler Driver) Put(ctx context.Context, file io.ReadCloser, dst string, s
|
|||
}
|
||||
|
||||
// 对文件名进行URLEncode
|
||||
fileName, err := url.QueryUnescape(path.Base(dst))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fileName := url.QueryEscape(path.Base(dst))
|
||||
|
||||
// 决定是否要禁用文件覆盖
|
||||
overwrite := "true"
|
||||
|
@ -294,7 +291,7 @@ func (handler Driver) Source(
|
|||
sourcePath := base64.RawURLEncoding.EncodeToString([]byte(path))
|
||||
signedURI, err = auth.SignURI(
|
||||
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,
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue