From 193a62e7f207803f54e9855e9f7ed8da4a08b7ed Mon Sep 17 00:00:00 2001 From: Omar Kassem Date: Tue, 18 Feb 2025 17:13:06 +0200 Subject: [PATCH] Potential fix for code scanning alert no. 14: Incomplete string escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- packages/playground/src/utils/gateway.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playground/src/utils/gateway.ts b/packages/playground/src/utils/gateway.ts index 86d26f2cd0..a5ad0c12d9 100644 --- a/packages/playground/src/utils/gateway.ts +++ b/packages/playground/src/utils/gateway.ts @@ -148,7 +148,7 @@ export function extractDomainIP(domainBackend: string) { const ip = domainBackend.replace("https://", "").replace("http://", ""); // Handle IPv6 if (domainBackend.includes("[")) { - const ipAddress = ip.replace("[", "").split("]:")[0]; + const ipAddress = ip.replace(/\[/g, "").split("]:")[0]; if (!ipAddress) { throw new Error(`Invalid input "${domainBackend}": Invalid IPv6 address format.`); }