mirror of
https://github.com/engineer-man/piston.git
synced 2025-06-07 18:56:26 +02:00
Trim output
This commit is contained in:
parent
bbbea5045a
commit
a2457edc6f
1 changed files with 4 additions and 6 deletions
|
@ -95,13 +95,11 @@ async function launch(res, language, body) {
|
||||||
result.output += chunk;
|
result.output += chunk;
|
||||||
});
|
});
|
||||||
|
|
||||||
result.stderr = result.stderr.substring(0, 65535);
|
result.stderr = result.stderr.trim().substring(0, 65535);
|
||||||
result.stdout = result.stdout.substring(0, 65535);
|
result.stdout = result.stdout.trim().substring(0, 65535);
|
||||||
result.output = result.output.substring(0, 65535);
|
result.output = result.output.trim().substring(0, 65535);
|
||||||
|
|
||||||
process.on('exit', () => {
|
process.on('exit', () => res.json(result));
|
||||||
res.json(result);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
app.get('/versions', (req, res) => {
|
app.get('/versions', (req, res) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue