Skip to content

Commit 0393789

Browse files
authored
Return nil proxy function if proxy not enabled (#16742)
Signed-off-by: Andrew Thornton <[email protected]>
1 parent 4debb74 commit 0393789

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/proxy/proxy.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ func Match(u string) bool {
5656
// Proxy returns the system proxy
5757
func Proxy() func(req *http.Request) (*url.URL, error) {
5858
if !setting.Proxy.Enabled {
59-
return nil
59+
return func(req *http.Request) (*url.URL, error) {
60+
return nil, nil
61+
}
6062
}
6163
if setting.Proxy.ProxyURL == "" {
6264
return http.ProxyFromEnvironment

0 commit comments

Comments
 (0)