From 697d59349847ec2bca7932e11c2d3eb47eb373c8 Mon Sep 17 00:00:00 2001 From: Ofek Date: Sat, 8 Nov 2025 15:13:36 +0200 Subject: [PATCH] Fix #8262: properly account for requests with query and no body (#8263) --- lib/handlers/noscript.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/handlers/noscript.ts b/lib/handlers/noscript.ts index 151c7e55a..a5ef39ed8 100644 --- a/lib/handlers/noscript.ts +++ b/lib/handlers/noscript.ts @@ -159,25 +159,25 @@ export class NoScriptHandler { async handleShareLink(req: express.Request, res: express.Response) { // Getting form data with proper type checking - handle both GET and POST const source = - typeof req.body.source === 'string' + typeof req.body?.source === 'string' ? req.body.source : typeof req.query.source === 'string' ? req.query.source : ''; const compiler = - typeof req.body.compiler === 'string' + typeof req.body?.compiler === 'string' ? req.body.compiler : typeof req.query.compiler === 'string' ? req.query.compiler : ''; const userArguments = - typeof req.body.userArguments === 'string' + typeof req.body?.userArguments === 'string' ? req.body.userArguments : typeof req.query.userArguments === 'string' ? req.query.userArguments : ''; const language = - typeof req.body.lang === 'string' + typeof req.body?.lang === 'string' ? req.body.lang : typeof req.query.language === 'string' ? req.query.language