From 20c9246f0ffd51e8133574ed0f58314950626cd5 Mon Sep 17 00:00:00 2001 From: Sushant Date: Wed, 22 Apr 2026 09:08:40 +0530 Subject: [PATCH] fix(api): make code submission comparison case-insensitive Updated normalizeCode in submissions API to use .toLowerCase() so that case mismatch bugs (like 'Int' vs 'int') do not fail correct solutions. --- src/pages/api/submissions/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/api/submissions/index.ts b/src/pages/api/submissions/index.ts index 31d63a8..9af456f 100644 --- a/src/pages/api/submissions/index.ts +++ b/src/pages/api/submissions/index.ts @@ -48,6 +48,9 @@ export const POST: APIRoute = async ({ request }) => { if (language !== 'python') { code = code.replace(/\s+/g, ' '); } + // Normalize case so "Int", "String", "Char", "Printf" etc. + // are treated the same as "int", "string", "char", "printf" + code = code.toLowerCase(); return code; }; const normalizedSubmitted = normalizeCode(submittedCode, challenge.language);