From 955118a3a678ff2993dc3ff149d11733fc4c7b79 Mon Sep 17 00:00:00 2001 From: Scan <103391616+scanash00@users.noreply.github.com> Date: Mon, 29 Sep 2025 15:29:25 -0400 Subject: [PATCH] fix: Incomplete URL substring sanitization Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/routes/apiKeys.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/apiKeys.ts b/src/routes/apiKeys.ts index b5cb210..5457e94 100644 --- a/src/routes/apiKeys.ts +++ b/src/routes/apiKeys.ts @@ -260,7 +260,7 @@ router.post( }); } - const isGemini = fullApiUrl.includes('generativelanguage.googleapis.com'); + const isGemini = parsedUrl.hostname === 'generativelanguage.googleapis.com'; if (isGemini) { const listModelsUrl = `https://generativelanguage.googleapis.com/v1beta/models?key=${apiKey}`; -- 2.51.2