Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions core/src/server/ws-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ export function createWebSocketHandler(
const action = parsed.action as string | undefined;
const exchange = parsed.exchange as string | undefined;

if (!id || !action || !exchange) {
sendError(ws, id, "Missing required fields: id, action, exchange");
const method = parsed.method as string | undefined;

if (!id || !action || !exchange || !method) {
sendError(ws, id, "Missing required fields: id, action, exchange, method");
return;
}

Expand All @@ -267,7 +269,7 @@ export function createWebSocketHandler(
id,
action: "subscribe",
exchange: exchangeName,
method: parsed.method as string,
method,
args: (parsed.args as unknown[]) || [],
credentials: parsed.credentials as ExchangeCredentials | undefined,
};
Expand All @@ -277,7 +279,7 @@ export function createWebSocketHandler(
id,
action: "unsubscribe",
exchange: exchangeName,
method: parsed.method as string,
method,
args: (parsed.args as unknown[]) || [],
};
handleUnsubscribe(ws, state, msg, exchangeName);
Expand Down
Loading