summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
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 {