summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorSchwobaland <Schwobaland@users.noreply.github.com>2017-03-02 01:36:42 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2017-03-02 08:36:42 +0800
commit2f7dc28b22f039b04aa200ee0909bf889d86e66e (patch)
treee073a76f9b5ab3aede0a91f5f2a6a7c4cf6d4a5d /modules
parentf3bf40908265d30d4de592dc55916a8a8cc03abb (diff)
downloadgitea-2f7dc28b22f039b04aa200ee0909bf889d86e66e.tar.gz
gitea-2f7dc28b22f039b04aa200ee0909bf889d86e66e.zip
add ProxyFromEnvironment if none set (#1096)
Diffstat (limited to 'modules')
-rw-r--r--modules/httplib/httplib.go6
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 {