Skip to content

Commit

Permalink
add ProxyFromEnvironment if none set (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schwobaland authored and lunny committed Mar 2, 2017
1 parent f3bf409 commit 2f7dc28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/httplib/httplib.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2f7dc28

Please sign in to comment.