mirror of https://github.com/gorilla/websocket.git
check for nil-ness of Dialer.TLSClientConfig before attempting to run the check
This commit is contained in:
parent
464f255e78
commit
a410921e1d
16
client.go
16
client.go
|
@ -186,13 +186,15 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
|
||||||
return nil, nil, errMalformedURL
|
return nil, nil, errMalformedURL
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, proto := range d.TLSClientConfig.NextProtos {
|
if d.TLSClientConfig != nil {
|
||||||
if proto != "http/1.1" {
|
for _, proto := range d.TLSClientConfig.NextProtos {
|
||||||
return nil, nil, fmt.Errorf(
|
if proto != "http/1.1" {
|
||||||
`protocol %q was given but is not supported;
|
return nil, nil, fmt.Errorf(
|
||||||
sharing tls.Config with net/http Transport can cause this error`,
|
`protocol %q was given but is not supported;
|
||||||
proto,
|
sharing tls.Config with net/http Transport can cause this error`,
|
||||||
)
|
proto,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue