fix(Webhook Node): Backward compatible form-data parsing for non-array fields (#6967)
This commit is contained in:
committed by
GitHub
parent
41db6371f0
commit
9455bcfef5
@@ -309,6 +309,11 @@ export async function executeWebhook(
|
||||
});
|
||||
req.body = await new Promise((resolve) => {
|
||||
form.parse(req, async (err, data, files) => {
|
||||
for (const key in data) {
|
||||
if (Array.isArray(data[key]) && data[key].length === 1) {
|
||||
data[key] = data[key][0];
|
||||
}
|
||||
}
|
||||
resolve({ data, files });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user