mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-03 19:17:29 -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://") {
 | 
						} else if strings.HasPrefix(str, "http://") {
 | 
				
			||||||
		schemePort = "http"
 | 
							schemePort = "http"
 | 
				
			||||||
		str = str[7:]
 | 
							str = str[7:]
 | 
				
			||||||
	} else if !strings.Contains(str, ":") {
 | 
					 | 
				
			||||||
		str += ":" // + Port
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	host, port, err = net.SplitHostPort(str)
 | 
						host, port, err = net.SplitHostPort(str)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							host, port, err = net.SplitHostPort(str + ":") // tack on empty port
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if err != nil && schemePort != "" {
 | 
						if err != nil && schemePort != "" {
 | 
				
			||||||
		host = str
 | 
							host = str
 | 
				
			||||||
		port = schemePort // assume port from scheme
 | 
							port = schemePort // assume port from scheme
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user