mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-22 13:06:27 +02:00
Trim and subtring only after executing
This commit is contained in:
parent
420a104f5c
commit
def096fbea
1 changed files with 6 additions and 4 deletions
|
@ -34,11 +34,13 @@ async function execute(res, language, body) {
|
|||
result.output += chunk;
|
||||
});
|
||||
|
||||
result.stderr = result.stderr.trim().substring(0, 65535);
|
||||
result.stdout = result.stdout.trim().substring(0, 65535);
|
||||
result.output = result.output.trim().substring(0, 65535);
|
||||
process.on('exit', () => {
|
||||
result.stderr = result.stderr.trim().substring(0, 65535);
|
||||
result.stdout = result.stdout.trim().substring(0, 65535);
|
||||
result.output = result.output.trim().substring(0, 65535);
|
||||
|
||||
process.on('exit', () => res.json(result));
|
||||
res.json(result);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue