Browse Source

Merge pull request #64 from agin719/addhost

add host
tags/v0.7.8
agin719 5 years ago
committed by GitHub
parent
commit
97c23c7210
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cos.go

4
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
}

Loading…
Cancel
Save