diff --git a/client.go b/client.go index 1f12d4ace..5cae78dd7 100644 --- a/client.go +++ b/client.go @@ -2,6 +2,7 @@ package fasthttp import ( "bufio" + "bytes" "crypto/tls" "errors" "fmt" @@ -477,6 +478,10 @@ func (c *Client) Do(req *Request, resp *Response) error { host := uri.Host() + if bytes.ContainsRune(host, ',') { + return fmt.Errorf("invalid host %q. Use HostClient for multiple hosts", host) + } + isTLS := false if uri.isHTTPS() { isTLS = true