chore(webdriver): fix sending multiple headers (#12170)

This commit is contained in:
Nikolay Vitkov 2024-03-27 20:10:41 +01:00 committed by GitHub
parent bc5af0fcf1
commit 730221d98d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -272,6 +272,9 @@ function getBidiHeaders(rawHeaders?: Record<string, unknown>) {
const headers: Bidi.Network.Header[] = [];
for (const [name, value] of Object.entries(rawHeaders ?? [])) {
if (!Object.is(value, undefined)) {
const values = Array.isArray(value) ? value : [value];
for (const value of values) {
headers.push({
name: name.toLowerCase(),
value: {
@ -281,6 +284,7 @@ function getBidiHeaders(rawHeaders?: Record<string, unknown>) {
});
}
}
}
return headers;
}