mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Return nil proxy function if proxy not enabled (#16742)
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user