musistudio/claude-code-router · error · Error

Only HTTP(S) URLs without embedded credentials are supported

Error message

Only HTTP(S) URLs without embedded credentials are supported.

What it means

Error "Only HTTP(S) URLs without embedded credentials are supported." thrown in musistudio/claude-code-router.

Source

Thrown at packages/core/src/routing/route-script-worker.ts:304

  if (typeof file !== "string" || !file.trim() || file.includes("\0")) {
    throw new Error("A valid filesystem path is required.");
  }
  if (file === "~") return path.resolve(os.homedir());
  if (file.startsWith("~/") || file.startsWith("~\\")) {
    return path.resolve(os.homedir(), file.slice(2));
  }
  return path.resolve(file);
}

function assertHttpUrl(rawUrl: string): void {
  let url: URL;
  try {
    url = new URL(rawUrl);
  } catch {
    throw new Error(`Invalid URL "${rawUrl}".`);
  }
  if ((url.protocol !== "http:" && url.protocol !== "https:") || url.username || url.password || !url.hostname) {
    throw new Error("Only HTTP(S) URLs without embedded credentials are supported.");
  }
}

function serializeResult(value: unknown): unknown {
  if (value === undefined) return undefined;
  const encoded = JSON.stringify(value);
  if (encoded === undefined) throw new Error("Script result must be JSON serializable.");
  if (Buffer.byteLength(encoded, "utf8") > maxResultBytes) {
    throw new Error(`Script result exceeds ${maxResultBytes} bytes.`);
  }
  return JSON.parse(encoded);
}

async function withDeadline<T>(promise: Promise<T>, deadline: number): Promise<T> {
  const remainingMs = Math.max(1, deadline - Date.now());
  let timer: NodeJS.Timeout | undefined;
  try {
    return await Promise.race([

View on GitHub (pinned to 99f24806c6)

When it happens

Trigger: Thrown at packages/core/src/routing/route-script-worker.ts:304 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of musistudio/claude-code-router@99f24806c6 (2026-08-27). Data as JSON: /api/errors/9ad7d2ad61c37349. Report an issue: GitHub.