summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/monaco-io/request
diff options
context:
space:
mode:
authorGary Kim <gary@garykim.dev>2020-12-10 07:06:27 +0800
committerGitHub <noreply@github.com>2020-12-10 00:06:27 +0100
commit41b4e64be9216f5fa6db694b7a8f47f34ca415be (patch)
tree559ff1a6e8896cba67aff5f519009a9611280818 /vendor/github.com/monaco-io/request
parent0d7315249d20bf9856605068074a7b6c6bcce835 (diff)
downloadmatterbridge-msglm-41b4e64be9216f5fa6db694b7a8f47f34ca415be.tar.gz
matterbridge-msglm-41b4e64be9216f5fa6db694b7a8f47f34ca415be.tar.bz2
matterbridge-msglm-41b4e64be9216f5fa6db694b7a8f47f34ca415be.zip
Update go-nc-talk (nctalk) (#1333)
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'vendor/github.com/monaco-io/request')
-rw-r--r--vendor/github.com/monaco-io/request/build.go18
-rw-r--r--vendor/github.com/monaco-io/request/model.go2
2 files changed, 13 insertions, 7 deletions
diff --git a/vendor/github.com/monaco-io/request/build.go b/vendor/github.com/monaco-io/request/build.go
index c2b1287b..56323d16 100644
--- a/vendor/github.com/monaco-io/request/build.go
+++ b/vendor/github.com/monaco-io/request/build.go
@@ -14,17 +14,18 @@ func (c *Client) buildRequest() (err error) {
return
}
- c.transport = &http.Transport{}
-
c.applyHTTPHeader()
c.applyBasicAuth()
c.applyClient()
c.applyTimeout()
c.applyCookies()
+ // Apply transport needs to be called before TLSConfig as TLSConfig modifies
+ // the http transport
+ c.applyTransport()
c.applyTLSConfig()
err = c.applyProxy()
- c.client.Transport = c.transport
+ c.client.Transport = c.Transport
return
}
@@ -84,15 +85,20 @@ func (c *Client) applyProxy() (err error) {
if proxy, err = url.Parse(c.ProxyURL); err != nil {
return
} else if proxy != nil {
- c.transport.Proxy = http.ProxyURL(proxy)
+ c.Transport.Proxy = http.ProxyURL(proxy)
}
}
return
}
func (c *Client) applyTLSConfig() {
- // &tls.Config{InsecureSkipVerify: true}
if c.TLSConfig != nil {
- c.transport.TLSClientConfig = c.TLSConfig
+ c.Transport.TLSClientConfig = c.TLSConfig
+ }
+}
+
+func (c *Client) applyTransport() {
+ if c.Transport == nil {
+ c.Transport = &http.Transport{}
}
}
diff --git a/vendor/github.com/monaco-io/request/model.go b/vendor/github.com/monaco-io/request/model.go
index 56016477..2a3041e3 100644
--- a/vendor/github.com/monaco-io/request/model.go
+++ b/vendor/github.com/monaco-io/request/model.go
@@ -39,12 +39,12 @@ type Client struct {
ContentType ContentType
Cookies []*http.Cookie
TLSConfig *tls.Config
+ Transport *http.Transport
// private
client *http.Client
requestURL requestURL
req *http.Request
- transport *http.Transport
}
// BasicAuth Add Username:Password as Basic Auth