good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 0e8d46d0 authored by Anmol Sethi's avatar Anmol Sethi
Browse files

Warn users against setting Timeout on http.Client

Closes #67
parent 9398f347
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,9 @@ func dial(ctx context.Context, u string, opts DialOptions) (_ *Conn, _ *http.Res
if opts.HTTPClient == nil {
opts.HTTPClient = http.DefaultClient
}
if opts.HTTPClient.Timeout > 0 {
return nil, nil, xerrors.Errorf("please use context for cancellation instead of http.Client.Timeout; see issue nhooyr.io/websocket#67")
}
if opts.HTTPHeader == nil {
opts.HTTPHeader = http.Header{}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment