fix
This commit is contained in:
parent
6c94bc29c9
commit
292f2f1ca3
|
@ -118,12 +118,16 @@ func (l *DataTransferLogic) DataTransfer(req *types.DataTransferReq, w http.Resp
|
||||||
case 2:
|
case 2:
|
||||||
token = strings.Trim(tokenSlice[0], " ")
|
token = strings.Trim(tokenSlice[0], " ")
|
||||||
debugToken = strings.Trim(tokenSlice[1], " ")
|
debugToken = strings.Trim(tokenSlice[1], " ")
|
||||||
r.Header.Set("Debug-Token", debugToken)
|
|
||||||
default:
|
default:
|
||||||
logx.Error("invalid ws token:", tokens)
|
logx.Error("invalid ws token:", tokens)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
r.Header.Set("Authorization", "Bearer "+token)
|
if token != "empty_token" && token != "" {
|
||||||
|
r.Header.Set("Authorization", "Bearer "+token)
|
||||||
|
}
|
||||||
|
if debugToken != "empty_debug_token" && debugToken != "" {
|
||||||
|
r.Header.Set("Debug-Token", debugToken)
|
||||||
|
}
|
||||||
//设置Sec-Websocket-Protocol
|
//设置Sec-Websocket-Protocol
|
||||||
upgrader.Subprotocols = []string{tokens}
|
upgrader.Subprotocols = []string{tokens}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user