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 tencent endpoint #6

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

fix tencent endpoint #6

wants to merge 1 commit into from

Conversation

wychl
Copy link

@wychl wychl commented Jul 27, 2018

fix tencent endpoint bug

@@ -125,7 +126,7 @@ func (client Client) Delete(path string) error {
if err != nil {
return err
}
req.Header.Set("Host", client.GetEndpoint())
req.Header.Set("Host", client.getHost())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the benefit of returning the URL in a fixed format rather than the current GetEndpoint implementation?

Actually, could you describe what is the problem and how you fixed it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

req.Header.Set("Host", client.getHost())

腾讯 cos host字段值设置成加速域名地址时报错,host只能是xxxx-123456.cos.ap-guangzhou.myqcloud.com格式的

client.GetEndpoint() 方法返回的是用户设置地址既可以是xxxx-123456.cos.ap-guangzhou.myqcloud.com 格式的,也可以是自己加速域名的地址。

client.getHost()方法返回的是xxxx-123456.cos.ap-guangzhou.myqcloud.com 格式的地址

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

既然 client.GetEndpoint() 可以被用户设置 那看起来已经足以满足要求了?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

req.Header.Set("Host", client.GetEndpoint()) 不能使用用户设置的域名

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.

2 participants