Trim and subtring only after executing

This commit is contained in:
Vrganj 2021-01-16 01:03:49 +01:00
parent 420a104f5c
commit def096fbea
1 changed files with 6 additions and 4 deletions

View File

@ -34,11 +34,13 @@ async function execute(res, language, body) {
result.output += chunk; result.output += chunk;
}); });
process.on('exit', () => {
result.stderr = result.stderr.trim().substring(0, 65535); result.stderr = result.stderr.trim().substring(0, 65535);
result.stdout = result.stdout.trim().substring(0, 65535); result.stdout = result.stdout.trim().substring(0, 65535);
result.output = result.output.trim().substring(0, 65535); result.output = result.output.trim().substring(0, 65535);
process.on('exit', () => res.json(result)); res.json(result);
});
} }
module.exports = { module.exports = {