@@ -22,9 +22,8 @@ type DialOptions struct {
2222 // http.Transport does this correctly.
2323 HTTPClient * http.Client
2424
25- // Header specifies the HTTP headers included in the handshake request.
26- // TODO rename to HTTPHeader
27- Header http.Header
25+ // HTTPHeader specifies the HTTP headers included in the handshake request.
26+ HTTPHeader http.Header
2827
2928 // Subprotocols lists the subprotocols to negotiate with the server.
3029 Subprotocols []string
@@ -48,8 +47,8 @@ func dial(ctx context.Context, u string, opts DialOptions) (_ *Conn, _ *http.Res
4847 if opts .HTTPClient == nil {
4948 opts .HTTPClient = http .DefaultClient
5049 }
51- if opts .Header == nil {
52- opts .Header = http.Header {}
50+ if opts .HTTPHeader == nil {
51+ opts .HTTPHeader = http.Header {}
5352 }
5453
5554 parsedURL , err := url .Parse (u )
@@ -68,7 +67,7 @@ func dial(ctx context.Context, u string, opts DialOptions) (_ *Conn, _ *http.Res
6867
6968 req , _ := http .NewRequest ("GET" , parsedURL .String (), nil )
7069 req = req .WithContext (ctx )
71- req .Header = opts .Header
70+ req .Header = opts .HTTPHeader
7271 req .Header .Set ("Connection" , "Upgrade" )
7372 req .Header .Set ("Upgrade" , "websocket" )
7473 req .Header .Set ("Sec-WebSocket-Version" , "13" )
0 commit comments