@nestjs/platform-ws 12.1.1 → 12.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adapters/ws-adapter.js +13 -1
- package/package.json +2 -2
package/adapters/ws-adapter.js
CHANGED
|
@@ -96,7 +96,19 @@ export class WsAdapter extends AbstractWsAdapter {
|
|
|
96
96
|
if (client.readyState !== READY_STATE.OPEN_STATE) {
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
-
|
|
99
|
+
// JSON.stringify throws on circular structures and BigInts, and on
|
|
100
|
+
// client-controlled payloads nested deep enough to overflow its native
|
|
101
|
+
// recursion (JSON.parse accepts any depth). A throw here escapes the
|
|
102
|
+
// subscriber, which RxJS rethrows asynchronously, killing the process.
|
|
103
|
+
let payload;
|
|
104
|
+
try {
|
|
105
|
+
payload = JSON.stringify(response);
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
this.logger.error(err);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
client.send(payload);
|
|
100
112
|
};
|
|
101
113
|
source$.subscribe(onMessage);
|
|
102
114
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/platform-ws",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.2",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@platform-ws)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"@nestjs/websockets": "^12.0.0",
|
|
34
34
|
"rxjs": "^7.1.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "8ab60aa1b2927fbe0e23135ffc65d610c623236a"
|
|
37
37
|
}
|