add ProxyFromEnvironment if none set (#1096)

pull/1104/head
Schwobaland 8 years ago committed by Lunny Xiao
parent f3bf409082
commit 2f7dc28b22
  1. 6
      modules/httplib/httplib.go

@ -303,9 +303,13 @@ func (r *Request) getResponse() (*http.Response, error) {
if trans == nil {
// create default transport
proxy := r.setting.Proxy
if proxy == nil {
proxy = http.ProxyFromEnvironment
}
trans = &http.Transport{
TLSClientConfig: r.setting.TLSClientConfig,
Proxy: r.setting.Proxy,
Proxy: proxy,
Dial: TimeoutDialer(r.setting.ConnectTimeout, r.setting.ReadWriteTimeout),
}
} else {

Loading…
Cancel
Save