Skip to content

Commit cb962aa

Browse files
author
Justin Fudally
committed
Fix parsing HAProxy
1 parent 69152c6 commit cb962aa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

go/config/haproxy_config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ func (h *HostPort) URL() *url.URL {
2727
}
2828

2929
func ParseHostPort(address string) (hostPort *HostPort, err error) {
30+
if !strings.Contains(address, ":") {
31+
return &HostPort{Host: address, Port: 80}, nil
32+
}
33+
3034
tokens := strings.SplitN(address, ":", 2)
3135
if len(tokens) != 2 {
3236
return nil, fmt.Errorf("Cannot parse HostPort from %s. Expected format is host:port", address)

0 commit comments

Comments
 (0)