aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-08-19 21:41:20 +0100
committerGitHub <noreply@github.com>2021-08-19 16:41:20 -0400
commit03937891e2fae759ca3ea37d2080e9e320d7c38d (patch)
tree7cac31276bc08f7b621ab3e507a5052068ac88ed
parent4debb74edada3a415f672cd03ee51a5b3b215c00 (diff)
downloadgitea-03937891e2fae759ca3ea37d2080e9e320d7c38d.tar.gz
gitea-03937891e2fae759ca3ea37d2080e9e320d7c38d.zip
Return nil proxy function if proxy not enabled (#16742)
Signed-off-by: Andrew Thornton <art27@cantab.net>
-rw-r--r--modules/proxy/proxy.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/proxy/proxy.go b/modules/proxy/proxy.go
index 0ab6ed3341..61730544b0 100644
--- a/modules/proxy/proxy.go
+++ b/modules/proxy/proxy.go
@@ -56,7 +56,9 @@ func Match(u string) bool {
// Proxy returns the system proxy
func Proxy() func(req *http.Request) (*url.URL, error) {
if !setting.Proxy.Enabled {
- return nil
+ return func(req *http.Request) (*url.URL, error) {
+ return nil, nil
+ }
}
if setting.Proxy.ProxyURL == "" {
return http.ProxyFromEnvironment