Sec-WebSocket-Protocol is capitalize instead of canonical

This commit is contained in:
Julien Salleyron 2018-03-06 14:56:47 +01:00 committed by Gary Burd
parent 6656ddce91
commit e426f23f06
1 changed files with 2 additions and 0 deletions

View File

@ -191,6 +191,8 @@ func (d *Dialer) Dial(urlStr string, requestHeader http.Header) (*Conn, *http.Re
k == "Sec-Websocket-Extensions" ||
(k == "Sec-Websocket-Protocol" && len(d.Subprotocols) > 0):
return nil, nil, errors.New("websocket: duplicate header not allowed: " + k)
case k == "Sec-Websocket-Protocol":
req.Header["Sec-WebSocket-Protocol"] = vs
default:
req.Header[k] = vs
}