This commit is contained in:
Yury Semikhatsky 2024-03-25 11:32:44 -07:00
parent 598407280c
commit fd58727d27
2 changed files with 2 additions and 3 deletions

View file

@ -189,9 +189,8 @@ export class APIRequestContext extends ChannelOwner<channels.APIRequestContextCh
// Convert file-like values to ServerFilePayload structs. // Convert file-like values to ServerFilePayload structs.
for (const [name, value] of Object.entries(options.multipart)) { for (const [name, value] of Object.entries(options.multipart)) {
if (Array.isArray(value)) { if (Array.isArray(value)) {
for (const item of value) { for (const item of value)
multipartData.push(await toFormField(name, item)); multipartData.push(await toFormField(name, item));
}
} else { } else {
multipartData.push(await toFormField(name, value)); multipartData.push(await toFormField(name, value));
} }

View file

@ -992,7 +992,7 @@ it('should support repeating names in multipart/form-data', async function({ con
'content-type': 'text/plain', 'content-type': 'text/plain',
}); });
res.end('OK.'); res.end('OK.');
}); });
}); });
const [postBody, response] = await Promise.all([ const [postBody, response] = await Promise.all([
postBodyPromise, postBodyPromise,