From 62afaeda0772b3caba7a721d147f3514241ac0cd Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Fri, 18 Aug 2023 16:20:45 +0800 Subject: [PATCH] fix --- server/websocket/internal/logic/datatransferlogic.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/websocket/internal/logic/datatransferlogic.go b/server/websocket/internal/logic/datatransferlogic.go index bbba31df..3cdd02ba 100644 --- a/server/websocket/internal/logic/datatransferlogic.go +++ b/server/websocket/internal/logic/datatransferlogic.go @@ -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")}