client: Allow Request.Host to omit a port
This commit is contained in:
@@ -86,8 +86,9 @@ func (c *Client) Do(req *Request) (*Response, error) {
|
||||
if req.Host != "" {
|
||||
hostname, port, err = net.SplitHostPort(req.Host)
|
||||
if err != nil {
|
||||
// Port is required
|
||||
return nil, err
|
||||
// Likely no port
|
||||
hostname = req.Host
|
||||
port = "1965"
|
||||
}
|
||||
// Punycode hostname
|
||||
hostname, err = punycodeHostname(hostname)
|
||||
|
||||
Reference in New Issue
Block a user