@@ -22,9 +22,8 @@ type DialOptions struct {
22
22
// http.Transport does this correctly.
23
23
HTTPClient * http.Client
24
24
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
28
27
29
28
// Subprotocols lists the subprotocols to negotiate with the server.
30
29
Subprotocols []string
@@ -48,8 +47,8 @@ func dial(ctx context.Context, u string, opts DialOptions) (_ *Conn, _ *http.Res
48
47
if opts .HTTPClient == nil {
49
48
opts .HTTPClient = http .DefaultClient
50
49
}
51
- if opts .Header == nil {
52
- opts .Header = http.Header {}
50
+ if opts .HTTPHeader == nil {
51
+ opts .HTTPHeader = http.Header {}
53
52
}
54
53
55
54
parsedURL , err := url .Parse (u )
@@ -68,7 +67,7 @@ func dial(ctx context.Context, u string, opts DialOptions) (_ *Conn, _ *http.Res
68
67
69
68
req , _ := http .NewRequest ("GET" , parsedURL .String (), nil )
70
69
req = req .WithContext (ctx )
71
- req .Header = opts .Header
70
+ req .Header = opts .HTTPHeader
72
71
req .Header .Set ("Connection" , "Upgrade" )
73
72
req .Header .Set ("Upgrade" , "websocket" )
74
73
req .Header .Set ("Sec-WebSocket-Version" , "13" )
0 commit comments