diff --git a/backend/server/src/index.ts b/backend/server/src/index.ts index 18078e7..d4bb713 100644 --- a/backend/server/src/index.ts +++ b/backend/server/src/index.ts @@ -618,7 +618,7 @@ io.on("connection", async (socket) => { // Generate code from cloudflare workers AI const generateCodePromise = fetch( - `${process.env.AI_WORKER_URL}/api?fileName=${fileName}&code=${code}&line=${line}&instructions=${instructions}`, + `${process.env.AI_WORKER_URL}/api?fileName=${encodeURIComponent(fileName)}&code=${encodeURIComponent(code)}&line=${encodeURIComponent(line)}&instructions=${encodeURIComponent(instructions)}`, { headers: { "Content-Type": "application/json",