mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Send ping frame using specified encoding
If base-64 encoding was requested, send the ping frame as a 0-length text frame, rather than as a 0-length binary frame.
This commit is contained in:
parent
d836b248b2
commit
8b1a00b6d9
@ -143,8 +143,14 @@ func messageCopy(ws *websocket.Conn, r io.Reader, base64Encode, ping bool, timeo
|
|||||||
buf := make([]byte, 2048)
|
buf := make([]byte, 2048)
|
||||||
if ping {
|
if ping {
|
||||||
resetTimeout(ws, timeout)
|
resetTimeout(ws, timeout)
|
||||||
if err := websocket.Message.Send(ws, []byte{}); err != nil {
|
if base64Encode {
|
||||||
return err
|
if err := websocket.Message.Send(ws, ""); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if err := websocket.Message.Send(ws, []byte{}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
|
Loading…
Reference in New Issue
Block a user