mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-24 21:25:45 +00:00
fix: prevent double serialization of websocket text messages. (#6182)
This commit is contained in:
@@ -150,8 +150,11 @@ class WsClient {
|
||||
messageToSend = message;
|
||||
}
|
||||
|
||||
// If messageToSend is a string, send it raw. If it is an object, stringify it.
|
||||
const payload = typeof messageToSend === 'string' ? messageToSend : JSON.stringify(messageToSend);
|
||||
|
||||
// Send the message
|
||||
connectionMeta.connection.send(JSON.stringify(messageToSend), (error) => {
|
||||
connectionMeta.connection.send(payload, (error) => {
|
||||
if (error) {
|
||||
this.eventCallback('main:ws:error', requestId, collectionUid, { error });
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user