diff options
author | Schwobaland <Schwobaland@users.noreply.github.com> | 2017-03-02 01:36:42 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-03-02 08:36:42 +0800 |
commit | 2f7dc28b22f039b04aa200ee0909bf889d86e66e (patch) | |
tree | e073a76f9b5ab3aede0a91f5f2a6a7c4cf6d4a5d /modules | |
parent | f3bf40908265d30d4de592dc55916a8a8cc03abb (diff) | |
download | gitea-2f7dc28b22f039b04aa200ee0909bf889d86e66e.tar.gz gitea-2f7dc28b22f039b04aa200ee0909bf889d86e66e.zip |
add ProxyFromEnvironment if none set (#1096)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/httplib/httplib.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/httplib/httplib.go b/modules/httplib/httplib.go index c4e613f765..981de2f6d9 100644 --- a/modules/httplib/httplib.go +++ b/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 { |