From 2cf0c5516a5693c534032fff9c9e9fb94d9f8e14 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 11 Feb 2022 09:55:35 +0200 Subject: Allow empty source --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/index.ts') diff --git a/src/index.ts b/src/index.ts index d1abded..1070915 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,7 +38,7 @@ app .use(json()) .post(RunnerApi.SubmitRequest.path, async (req, res) => { const body: RunnerApi.SubmitRequest.Body | undefined = req.body - if (!body || !body.source || body.source.length > MAX_SRC_LENGTH) { + if (!body || body.source === undefined || body.source.length > MAX_SRC_LENGTH) { return res.sendStatus(400) } -- cgit v1.3