


























@@ -8,7 +8,6 @@ import { mockPinnedHostnameResolution } from "openclaw/plugin-sdk/testing";
88import { optimizeImageToPng } from "openclaw/plugin-sdk/web-media";
99import sharp from "sharp";
1010import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest";
11-import { sendVoiceMessageDiscord } from "../../discord/src/send.js";
1211import {
1312LocalMediaAccessError,
1413loadWebMedia,
@@ -317,35 +316,6 @@ describe("web media loading", () => {
317316});
318317});
319318320-describe("Discord voice message input hardening", () => {
321-it("rejects unsafe voice message inputs", async () => {
322-const cases = [
323-{
324-name: "local path outside allowed media roots",
325-candidate: path.join(process.cwd(), "package.json"),
326-expectedMessage: /Local media path is not under an allowed directory/i,
327-},
328-{
329-name: "private-network URL",
330-candidate: "http://127.0.0.1/voice.ogg",
331-expectedMessage: /Failed to fetch media|Blocked|private|internal/i,
332-},
333-{
334-name: "non-http URL scheme",
335-candidate: "rtsp://example.com/voice.ogg",
336-expectedMessage: /Local media path is not under an allowed directory|ENOENT|no such file/i,
337-},
338-] as const;
339-340-for (const testCase of cases) {
341-await expect(
342-sendVoiceMessageDiscord("channel:123", testCase.candidate, { cfg: {} as never }),
343-testCase.name,
344-).rejects.toThrow(testCase.expectedMessage);
345-}
346-});
347-});
348-349319describe("local media root guard", () => {
350320it("rejects local paths outside allowed roots", async () => {
351321// Explicit roots that don't contain the temp file.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。