Skip to content

Commit d9f60ea

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent b732a40 commit d9f60ea

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/api/chat/route.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ export async function POST(request: NextRequest) {
105105
const selectedPageSlug = routeResult
106106
.trim()
107107
.split(/\s+/)[0]
108-
?.trim() as typeof path.page | undefined;
108+
?.replace(/^slug:/i, "")
109+
.replace(/^["'`]+|["'`.,:;]+$/g, "")
110+
.trim() as typeof path.page | undefined;
109111
if (selectedPageSlug && langEntry.pages.some((page) => page.slug === selectedPageSlug)) {
110112
targetPath = {
111113
lang: path.lang,

0 commit comments

Comments
 (0)