From 3e6609a85355b7606d593c2ad4570c4ca101cf83 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Sun, 24 May 2026 18:48:00 -0300 Subject: [PATCH] fix(security): resolve CodeQL alerts for regex and replace --- src/app/(dashboard)/dashboard/providers/utils/buildCurl.ts | 2 +- src/lib/copilot/engine.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/(dashboard)/dashboard/providers/utils/buildCurl.ts b/src/app/(dashboard)/dashboard/providers/utils/buildCurl.ts index 1156225d5e..8d9dc22b2c 100644 --- a/src/app/(dashboard)/dashboard/providers/utils/buildCurl.ts +++ b/src/app/(dashboard)/dashboard/providers/utils/buildCurl.ts @@ -54,7 +54,7 @@ export function buildCurl({ endpoint, method = "POST", headers, body }: CurlOpti // Remove trailing backslash from last non-URL line const last = lines.length - 1; - lines[last - 1] = lines[last - 1].replace(/ \\$/, " \\"); + lines[last - 1] = lines[last - 1].replace(/ \\$/, ""); return lines.join("\n"); } diff --git a/src/lib/copilot/engine.ts b/src/lib/copilot/engine.ts index 2612bc2e9b..f6c4cf334d 100644 --- a/src/lib/copilot/engine.ts +++ b/src/lib/copilot/engine.ts @@ -35,7 +35,10 @@ function getKnowledgeResponse(query: string): string | null { const q = query.toLowerCase(); // Architecture questions - if (/architecture|arquitectura|pipeline|request.*flow|request.*path/.test(q)) { + if ( + /architecture|arquitectura|pipeline/.test(q) || + (q.includes("request") && (q.includes("flow") || q.includes("path"))) + ) { return `## OmniRoute Architecture The request pipeline flows through: