mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore(webdriver): fix sending multiple headers (#12170)
This commit is contained in:
parent
bc5af0fcf1
commit
730221d98d
@ -272,13 +272,17 @@ function getBidiHeaders(rawHeaders?: Record<string, unknown>) {
|
||||
const headers: Bidi.Network.Header[] = [];
|
||||
for (const [name, value] of Object.entries(rawHeaders ?? [])) {
|
||||
if (!Object.is(value, undefined)) {
|
||||
headers.push({
|
||||
name: name.toLowerCase(),
|
||||
value: {
|
||||
type: 'string',
|
||||
value: String(value),
|
||||
},
|
||||
});
|
||||
const values = Array.isArray(value) ? value : [value];
|
||||
|
||||
for (const value of values) {
|
||||
headers.push({
|
||||
name: name.toLowerCase(),
|
||||
value: {
|
||||
type: 'string',
|
||||
value: String(value),
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user