mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 07:24:52 +09:00
Fix debug dump-ws crashing the controller
When ws was updated to version 8 it came with a breaking change where message data was no longer utf8 decoded from binary to a string. The main codepath handling messages was updated to handle this but the ws dump path was not resulting in the controller crashing when receiving a message that is then forwarded to the dumper without decoding. Fix by decoding the message in the dump-ws path.
This commit is contained in:
1 parent
1f61e49599
commit
32d70a83d1
1 file changed
+1
-1
@@ -107,7 +107,7 @@ export default class WsServer {
|
||||
socket.on("message", (message: WebSocket.RawData) => {
|
||||
wsMessageCounter.labels("in").inc();
|
||||
if (!socket.clusterio_ignore_dump) {
|
||||
this.controller.debugEvents.emit("message", { direction: "in", content: message });
|
||||
this.controller.debugEvents.emit("message", { direction: "in", content: message.toString("utf8") });
|
||||
}
|
||||
});
|
||||
let originalSend = socket.send;
|
||||
|
||||
Reference in new issue
Block a user