We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc26218 commit a383457Copy full SHA for a383457
httpclient/httpclient_transport.go
@@ -0,0 +1,26 @@
1
+package httpclient
2
+
3
+import "net/http"
4
5
+type httpClientRoundTripper struct {
6
+ transport http.RoundTripper
7
+ config *Config
8
+}
9
10
+func newHTTPClientTransport(config *Config) http.RoundTripper {
11
+ proxy := http.ProxyURL(config.Proxy)
12
13
+ transport := &http.Transport{
14
+ Proxy: proxy,
15
+ }
16
17
+ return &httpClientRoundTripper{
18
+ transport: transport,
19
+ config: config,
20
21
22
23
+func (h *httpClientRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
24
+ req.Header.Add("User-Agent", h.config.UserAgent)
25
+ return h.transport.RoundTrip(req)
26
0 commit comments