]> source.dussan.org Git - gitea.git/commitdiff
Return nil proxy function if proxy not enabled (#16742)
authorzeripath <art27@cantab.net>
Thu, 19 Aug 2021 20:41:20 +0000 (21:41 +0100)
committerGitHub <noreply@github.com>
Thu, 19 Aug 2021 20:41:20 +0000 (16:41 -0400)
Signed-off-by: Andrew Thornton <art27@cantab.net>
modules/proxy/proxy.go

index 0ab6ed334193cd493e16aea895716e07867e6702..61730544b078bbd07cb47775451ac16447944c2b 100644 (file)
@@ -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