aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2022-02-11 09:55:35 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2022-02-11 09:55:35 +0200
commit2cf0c5516a5693c534032fff9c9e9fb94d9f8e14 (patch)
tree73d65f36d3a17d93165449061e071e639dbd7ab4
parentc1b9860963b5d98b89c890d9e3e552207b4e1371 (diff)
Allow empty source
-rw-r--r--src/index.ts2
1 files changed, 1 insertions, 1 deletions
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)
}