From 32d6d10f2e0d930f87b5e58d1744b0dd4ddf7b78 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 20 Feb 2026 19:46:43 +0800 Subject: [PATCH] fix(fal-image): normalize fullwidth colon in API credentials --- lib/ai/providers/fal-image.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ai/providers/fal-image.ts b/lib/ai/providers/fal-image.ts index 9187634f0..05a303e72 100644 --- a/lib/ai/providers/fal-image.ts +++ b/lib/ai/providers/fal-image.ts @@ -29,7 +29,11 @@ const DEFAULT_SAFETY_TOLERANCE = "4"; const DEFAULT_TIMEOUT_MS = 180000; function normalizeFalCredentials(apiKey: string) { - const normalized = apiKey.replace(/\u00a0/g, " ").trim(); + const normalized = apiKey + .replace(/\u00a0/g, " ") + .replace(/\u3000/g, " ") + .replace(/:/g, ":") + .trim(); const stripped = normalized.replace(/^bearer\s+/i, "").replace(/^key\s+/i, ""); const kvMatch = stripped.match(/^(?:fal[_-]?key|api[_-]?key|token)\s*[::]\s*(.+)$/i); if (kvMatch?.[1]) {