mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-04 03:27:23 -05:00 
			
		
		
		
	Allow IPv6 address without port (fixes #80)
This commit is contained in:
		
							parent
							
								
									e42c6ab520
								
							
						
					
					
						commit
						5e8491cf7f
					
				@ -265,11 +265,12 @@ func standardAddress(str string) (host, port string, err error) {
 | 
			
		||||
	} else if strings.HasPrefix(str, "http://") {
 | 
			
		||||
		schemePort = "http"
 | 
			
		||||
		str = str[7:]
 | 
			
		||||
	} else if !strings.Contains(str, ":") {
 | 
			
		||||
		str += ":" // + Port
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	host, port, err = net.SplitHostPort(str)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		host, port, err = net.SplitHostPort(str + ":") // tack on empty port
 | 
			
		||||
	}
 | 
			
		||||
	if err != nil && schemePort != "" {
 | 
			
		||||
		host = str
 | 
			
		||||
		port = schemePort // assume port from scheme
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user