Skip to content

Commit

Permalink
Return nil proxy function if proxy not enabled (#16742)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Aug 19, 2021
1 parent 4debb74 commit 0393789
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0393789

Please sign in to comment.