Ignore malformed extra-field websocket requests safely
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
2642ce3c4b
commit
f28015c47e
2 files changed
+16
No files matched your search
@@ -2102,6 +2102,14 @@ async function main() {
|
||||
|
||||
ws.send("not-json");
|
||||
ws.send(JSON.stringify({ foo: "bar" }));
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
type: "request",
|
||||
id: "smoke-malformed-extra-field",
|
||||
method: "app.health",
|
||||
unexpected: true,
|
||||
}),
|
||||
);
|
||||
const postMalformedHealthResponse = await sendWsRequest(ws, {
|
||||
id: "smoke-health-after-malformed",
|
||||
method: "app.health",
|
||||
|
||||
@@ -748,6 +748,14 @@ describe("runtimeApiServer", () => {
|
||||
|
||||
client.socket.send("not-json");
|
||||
client.socket.send(JSON.stringify({ type: "request", id: "", method: "" }));
|
||||
client.socket.send(
|
||||
JSON.stringify({
|
||||
type: "request",
|
||||
id: "malformed-extra-field",
|
||||
method: "todos.list",
|
||||
unexpected: true,
|
||||
}),
|
||||
);
|
||||
|
||||
const response = await sendRequest(
|
||||
client.socket,
|
||||
|
||||
Reference in new issue
Block a user