Silently drop stale route signals (#309)
This commit is contained in:
1 parent
bbeb99da38
commit
aa3043b905
2 files changed
+13
-5
No files matched your search
@@ -1530,11 +1530,6 @@ export class SignalingServer {
|
||||
: parentToChild || childToParent;
|
||||
const authorized = candidateAuthorized ?? assignedEdgeAuthorized;
|
||||
if (!authorized) {
|
||||
this.sendError(
|
||||
sourceSocket,
|
||||
"FORBIDDEN",
|
||||
"Signal target is not authorized by the media assignment",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -920,6 +920,19 @@ describe("WebSocket signaling", () => {
|
||||
(viewer) => viewer.peerId === relayParentPeerId,
|
||||
),
|
||||
).toBe(true);
|
||||
host.inbox.ignore("route-update");
|
||||
host.socket.send(
|
||||
JSON.stringify({
|
||||
type: "signal",
|
||||
targetPeerId: relay.peerId,
|
||||
payload: {
|
||||
kind: "candidate",
|
||||
connectionId: "stale_connection_12345678",
|
||||
candidate: null,
|
||||
},
|
||||
}),
|
||||
);
|
||||
await host.inbox.expectNone(40);
|
||||
|
||||
viewers[2].socket.send(
|
||||
JSON.stringify({ type: "set-display-name", displayName: "后来改名" }),
|
||||
|
||||
Reference in new issue
Block a user