diegosouzapw/OmniRoute · error

Video Bridge accepts only HTTPS URLs or video data URIs

Error message

Video Bridge accepts only HTTPS URLs or video data URIs

What it means

Scheme guard in loadVideoPartBytes: a remote video part's ref is neither a data URI nor an https:// URL. Plain http://, ftp://, or file:// refs are refused to enforce the SSRF/transport security policy — remote fetch only happens over HTTPS with pinDns and public-only guarding.

Solutions

  1. Rewrite http:// source URLs to https:// upstream of the Video Bridge
  2. Reject non-HTTPS schemes at request validation with an explicit client error
  3. Never relax to file:// or http://; keep the public-only fetch guard enabled
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/guardrails/videoBridgeHelpers.ts:510 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/749cb7c07c0a468f. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/guardrails/videoBridgeHelpers.ts:510

 * @param deps - Injectable external download boundary.
 * @returns Validated video bytes suitable for hashing and extraction.
 * @throws When the source, size, deadline, or abort policy rejects the input.
 */
export async function loadVideoPartBytes(
  part: VideoPart,
  maxBytes: number,
  timeoutMs: number,
  signal: AbortSignal,
  deps: DescribeVideoDependencies
): Promise<Buffer> {
  if (signal.aborted) throw new Error("Video Bridge processing timed out or was aborted");
  const dataBytes = decodeVideoDataUri(part.ref, Math.min(maxBytes, VIDEO_BRIDGE_INLINE_MAX_BYTES));
  let bytes: Buffer;
  if (dataBytes) {
    bytes = dataBytes;
  } else {
    if (!part.ref.startsWith("https://")) {
      throw new Error("Video Bridge accepts only HTTPS URLs or video data URIs");
    }
    const fetchRemote =
      deps.fetchRemote ??
      ((url: string, options: { enforceHttps: true; signal: AbortSignal }) =>
        fetchRemoteMedia(url, {
          enforceHttps: options.enforceHttps,
          guard: "public-only",
          maxBytes,
          pinDns: true,
          signal: options.signal,
          timeoutMs,
        }));
    bytes = (await fetchRemote(part.ref, { enforceHttps: true, signal })).buffer;
  }
  if (bytes.byteLength > maxBytes) {
    throw new Error("Video exceeds the maximum size");
  }
  return bytes;

View on GitHub (pinned to a179ffed5b)