import { resolvePinnedHostnameWithPolicy, type SsrFPolicy } from "openclaw/plugin-sdk/ssrf-runtime"; import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
export type LineOutboundMediaKind = "image" | "video" | "audio";
export async function validateLineMediaUrl(url: string): Promise<void> {
let parsed: URL; try {
parsed = new URL(url);
} catch { thrownew Error(`LINE outbound media URL must be a valid URL: ${url}`);
} if (parsed.protocol !== "https:") { thrownew Error(`LINE outbound media URL must use HTTPS: ${url}`);
} if (url.length > 2000) { thrownew Error(`LINE outbound media URL must be 2000 chars or less (got ${url.length})`);
}
await resolvePinnedHostnameWithPolicy(parsed.hostname, {
policy: LINE_OUTBOUND_MEDIA_SSRF_POLICY,
});
}
export function detectLineMediaKind(mimeType: string): LineOutboundMediaKind { const normalized = normalizeLowercaseStringOrEmpty(mimeType); if (normalized.startsWith("image/")) { return"image";
} if (normalized.startsWith("video/")) { return"video";
} if (normalized.startsWith("audio/")) { return"audio";
} return"image";
}
try { const parsed = new URL(trimmedUrl); if (parsed.protocol !== "https:") { thrownew Error(`LINE outbound media URL must use HTTPS: ${trimmedUrl}`);
}
} catch (e) { if (e instanceof Error && e.message.startsWith("LINE outbound")) { throw e;
}
} thrownew Error("LINE outbound media currently requires a public HTTPS URL");
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-13)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.