Skip to content

Commit d140949

Browse files
committed
fix: stdin required in validator
1 parent 67d7d6d commit d140949

File tree

3 files changed

+51
-2
lines changed

3 files changed

+51
-2
lines changed

package-lock.json

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/api/run/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class RunController {
3232
id: job.id,
3333
source: req.body.source,
3434
lang: req.body.lang,
35-
stdin: req.body.stdin,
35+
stdin: req.body.stdin || '',
3636
timelimit: req.body.timelimit,
3737
scenario: 'run'
3838
}, req.body.enc)

src/routes/api/run/validators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class RunValidator extends BaseValidator {
2222
.valid('sync', 'callback', 'poll'),
2323
stdin: Joi
2424
.string()
25-
.default(''),
25+
.allow(''),
2626
timelimit: Joi
2727
.number(),
2828
callback: Joi

0 commit comments

Comments
 (0)