Skip to content

Commit e426f23

Browse files
juliensgaryburd
authored andcommitted
Sec-WebSocket-Protocol is capitalize instead of canonical
1 parent 6656ddc commit e426f23

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ func (d *Dialer) Dial(urlStr string, requestHeader http.Header) (*Conn, *http.Re
191191
k == "Sec-Websocket-Extensions" ||
192192
(k == "Sec-Websocket-Protocol" && len(d.Subprotocols) > 0):
193193
return nil, nil, errors.New("websocket: duplicate header not allowed: " + k)
194+
case k == "Sec-Websocket-Protocol":
195+
req.Header["Sec-WebSocket-Protocol"] = vs
194196
default:
195197
req.Header[k] = vs
196198
}

0 commit comments

Comments
 (0)