瀏覽代碼

Sec-WebSocket-Protocol is capitalize instead of canonical

Julien Salleyron 7 年之前
父節點
當前提交
e426f23f06
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      client.go

+ 2 - 0
client.go

@@ -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
 		}