agin719
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
0 deletions
-
cos.go
|
|
@ -69,6 +69,7 @@ func NewBucketURL(bucketName, region string, secure bool) *url.URL { |
|
|
|
type Client struct { |
|
|
|
client *http.Client |
|
|
|
|
|
|
|
Host string |
|
|
|
UserAgent string |
|
|
|
BaseURL *BaseURL |
|
|
|
|
|
|
@ -158,6 +159,9 @@ func (c *Client) newRequest(ctx context.Context, baseURL *url.URL, uri, method s |
|
|
|
if req.Header.Get("Content-Type") == "" && contentType != "" { |
|
|
|
req.Header.Set("Content-Type", contentType) |
|
|
|
} |
|
|
|
if c.Host != "" { |
|
|
|
req.Host = c.Host |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|