mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 20:12:52 +08:00
feat: report live voice status and harden target handling
This commit is contained in:
1 parent
e0d5916a86
commit
0a4fff6f6f
19 files changed
+1003
-101
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { isSafeOpenTargetForPrefill } from "./open-target-policy.js";
|
||||
|
||||
test("open-mode target prefill follows the same allow/deny result as the join policy", async () => {
|
||||
assert.equal(await isSafeOpenTargetForPrefill({ host: "198.51.100.24", port: 9987 }, {
|
||||
resolveTarget: async (target) => target,
|
||||
}), true);
|
||||
assert.equal(await isSafeOpenTargetForPrefill({ host: "teamspeak", port: 9987 }, {
|
||||
resolveTarget: async () => { throw new Error("private or unresolved target"); },
|
||||
}), false);
|
||||
});
|
||||
|
||||
test("open-mode target prefill fails closed when DNS validation stalls", async () => {
|
||||
const result = await isSafeOpenTargetForPrefill({ host: "internal.example", port: 9987 }, {
|
||||
timeoutMs: 10,
|
||||
resolveTarget: async () => new Promise(() => undefined),
|
||||
});
|
||||
assert.equal(result, false);
|
||||
});
|
||||
Reference in new issue
Block a user