Skip to content

Commit

Permalink
🐞 fix(header): 使用兼容方法设置heade
Browse files Browse the repository at this point in the history
解决header自动转换首字母大写的问题
  • Loading branch information
fnoopv committed Mar 2, 2023
1 parent 21335f5 commit 9c11f94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions csb.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ func (c *CSBClient) Do(ctx context.Context, result interface{}) error {
// add request header
signHeaders := signParams(params, c.ApiName, c.ApiVersion, c.accessKey, c.secretKey)
if c.Headers != nil {
req.SetHeaders(c.Headers)
req.SetHeadersNonCanonical(c.Headers)
}
req.SetHeaders(signHeaders).SetHeader("Content-Type", c.ContentType).SetResult(result)
req.SetHeadersNonCanonical(signHeaders).SetHeader("Content-Type", c.ContentType).SetResult(result)

method := strings.ToLower(c.ApiMethod)
if method == "get" {
Expand Down

0 comments on commit 9c11f94

Please sign in to comment.