diff options
Diffstat (limited to 'plugin/pkg/parse/host.go')
-rw-r--r-- | plugin/pkg/parse/host.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugin/pkg/parse/host.go b/plugin/pkg/parse/host.go index 9206a033d..c396dc853 100644 --- a/plugin/pkg/parse/host.go +++ b/plugin/pkg/parse/host.go @@ -33,6 +33,14 @@ func HostPortOrFile(s ...string) ([]string, error) { var servers []string for _, h := range s { trans, host := Transport(h) + if len(host) == 0 { + return servers, fmt.Errorf("invalid address: %q", h) + } + + if trans == transport.UNIX { + servers = append(servers, trans+"://"+host) + continue + } addr, _, err := net.SplitHostPort(host) |