From 7e5844bcb1c42a7852ad36e8b82daabcfb0ac59e Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 15 Oct 2021 16:14:06 +1300 Subject: [PATCH] require arleast 1 utf-8 encoded file --- api/src/api/v2.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/src/api/v2.js b/api/src/api/v2.js index f9a3f66..d772c5a 100644 --- a/api/src/api/v2.js +++ b/api/src/api/v2.js @@ -87,6 +87,15 @@ function get_job(body) { } } + if ( + files.filter(file => !file.encoding || file.encoding === 'utf8') + .length === 0 + ) { + return reject({ + message: 'files must include at least one utf8 encoded file', + }); + } + const rt = runtime.get_latest_runtime_matching_language_version( language, version