| skipped 24 lines |
25 | 25 | | bodyCSP []string |
26 | 26 | | ) |
27 | 27 | | |
28 | | - | resp, err := client.Get(url) |
| 28 | + | req, err := http.NewRequest(http.MethodGet, url, nil) |
| 29 | + | if err != nil { |
| 30 | + | return result, err |
| 31 | + | } |
| 32 | + | |
| 33 | + | resp, err := client.Do(req) |
29 | 34 | | if err != nil { |
30 | 35 | | return result, err |
31 | 36 | | } |
| skipped 68 lines |
100 | 105 | | } |
101 | 106 | | |
102 | 107 | | func customClient(timeout int) *http.Client { |
103 | | - | //ref: Copy and modify defaults from https://golang.org/src/net/http/transport.go |
104 | | - | //Note: Clients and Transports should only be created once and reused |
105 | 108 | | transport := http.Transport{ |
106 | 109 | | TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, |
107 | | - | Proxy: http.ProxyFromEnvironment, |
108 | 110 | | Dial: (&net.Dialer{ |
109 | | - | // Modify the time to wait for a connection to establish |
110 | 111 | | Timeout: time.Duration(timeout) * time.Second, |
111 | 112 | | KeepAlive: KeepAlive * time.Second, |
112 | 113 | | }).Dial, |
| skipped 17 lines |