This commit is contained in:
laodaming 2023-08-18 16:20:45 +08:00
parent b8ca7360b1
commit 62afaeda07

View File

@ -80,6 +80,7 @@ type wsConnectItem struct {
}
func (l *DataTransferLogic) DataTransfer(w http.ResponseWriter, r *http.Request) {
//把子协议携带的token设置到标准token头信息中
r.Header.Set("Authorization", "Bearer "+r.Header.Get("Sec-Websocket-Protocol"))
//设置Sec-Websocket-Protocol
upgrade.Subprotocols = []string{r.Header.Get("Sec-Websocket-Protocol")}