mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 02:27:19 -04:00 
			
		
		
		
	FastCGI: IPv6 when parsing r.RemoteAddr
This commit is contained in:
		
							parent
							
								
									a8c8b48390
								
							
						
					
					
						commit
						d8be787f39
					
				| @ -182,7 +182,7 @@ func (h Handler) buildEnv(r *http.Request, rule Rule, fpath string) (map[string] | ||||
| 
 | ||||
| 	// Separate remote IP and port; more lenient than net.SplitHostPort | ||||
| 	var ip, port string | ||||
| 	if idx := strings.Index(r.RemoteAddr, ":"); idx > -1 { | ||||
| 	if idx := strings.LastIndex(r.RemoteAddr, ":"); idx > -1 { | ||||
| 		ip = r.RemoteAddr[:idx] | ||||
| 		port = r.RemoteAddr[idx+1:] | ||||
| 	} else { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user