mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	add ProxyFromEnvironment if none set (#1096)
This commit is contained in:
		@@ -303,9 +303,13 @@ func (r *Request) getResponse() (*http.Response, error) {
 | 
			
		||||
 | 
			
		||||
	if trans == nil {
 | 
			
		||||
		// create default transport
 | 
			
		||||
		proxy := r.setting.Proxy
 | 
			
		||||
		if proxy == nil {
 | 
			
		||||
			proxy = http.ProxyFromEnvironment
 | 
			
		||||
		}
 | 
			
		||||
		trans = &http.Transport{
 | 
			
		||||
			TLSClientConfig: r.setting.TLSClientConfig,
 | 
			
		||||
			Proxy:           r.setting.Proxy,
 | 
			
		||||
			Proxy:           proxy,
 | 
			
		||||
			Dial:            TimeoutDialer(r.setting.ConnectTimeout, r.setting.ReadWriteTimeout),
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user