Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(s3): escape CopySource request header when copying files #7860

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jason-Fly
Copy link
Contributor

修复问题

#7858 :重命名或复制文件名含有中文的文件,Signature计算错误

问题原因

复制文件时,请求头部X-Amz-Copy-Source是源文件的路径,计算Signature时会用到它;华为云是按转义后的CopySource计算Signature,而alist没有做转义,导致签名不一致报错
image

其实AWS官方也是要求做转义的,不过经过测试腾讯云对象存储COS对两种情况都做了兼容,所以没有报错
image

解决方案

对CopySource增加转义操作

自测

华为云-重命名含中文的文件 --- OK
image

华为云-重命名含中文的目录 --- OK
华为云-重命名英文的文件 --- OK
腾讯云-重命名含中文的文件 --- OK
腾讯云-重命名英文的文件 --- OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant