Return nil proxy function if proxy not enabled (#16742)

Signed-off-by: Andrew Thornton <art27@cantab.net>
pull/16738/head^2
zeripath 3 years ago committed by GitHub
parent 4debb74eda
commit 03937891e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      modules/proxy/proxy.go

@ -56,7 +56,9 @@ func Match(u string) bool {
// Proxy returns the system proxy // Proxy returns the system proxy
func Proxy() func(req *http.Request) (*url.URL, error) { func Proxy() func(req *http.Request) (*url.URL, error) {
if !setting.Proxy.Enabled { if !setting.Proxy.Enabled {
return nil return func(req *http.Request) (*url.URL, error) {
return nil, nil
}
} }
if setting.Proxy.ProxyURL == "" { if setting.Proxy.ProxyURL == "" {
return http.ProxyFromEnvironment return http.ProxyFromEnvironment

Loading…
Cancel
Save