Skip to content

Commit 6e01829

Browse files
committed
[core] Restrict array buffer in post body for symbol file upload
1 parent 3b0d689 commit 6e01829

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

api/api.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,18 @@ plugins.connectToAllDatabases().then(function() {
370370
}
371371

372372
const form = new formidable.IncomingForm(formidableOptions);
373-
req.body = [];
374-
req.on('data', (data) => {
375-
req.body.push(data);
376-
});
373+
if (/crash_symbols\/(add_symbol|upload_symbol)/.test(req.url)) {
374+
req.body = [];
375+
req.on('data', (data) => {
376+
req.body.push(data);
377+
});
378+
}
379+
else {
380+
req.body = '';
381+
req.on('data', (data) => {
382+
req.body += data;
383+
});
384+
}
377385

378386
let multiFormData = false;
379387
// Check if we have 'multipart/form-data'

0 commit comments

Comments
 (0)