mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
fix(http): Add proxy transport
This commit is contained in:
@@ -57,17 +57,13 @@ func New(opts map[string]interface{}) *Cli {
|
||||
}
|
||||
} else {
|
||||
transport := &http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
TLSClientConfig: &tls.Config{},
|
||||
}
|
||||
if insecureSkipVerify, ok := opts["insecure"].(bool); ok {
|
||||
transport.TLSClientConfig.InsecureSkipVerify = insecureSkipVerify
|
||||
}
|
||||
|
||||
if os.Getenv("HTTP_PROXY") != "" {
|
||||
proxyURL, _ := url.Parse(os.Getenv("HTTP_PROXY"))
|
||||
transport.Proxy = http.ProxyURL(proxyURL)
|
||||
}
|
||||
|
||||
ua = &http.Client{
|
||||
Jar: cookieJar,
|
||||
Transport: transport,
|
||||
|
||||
Reference in New Issue
Block a user