chore(webdriver): fix issues when removing header (#12167)

This commit is contained in:
Nikolay Vitkov 2024-03-27 19:43:09 +01:00 committed by GitHub
parent b1d30a6158
commit bc5af0fcf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -271,13 +271,15 @@ export class BidiHTTPRequest extends HTTPRequest {
function getBidiHeaders(rawHeaders?: Record<string, unknown>) { function getBidiHeaders(rawHeaders?: Record<string, unknown>) {
const headers: Bidi.Network.Header[] = []; const headers: Bidi.Network.Header[] = [];
for (const [name, value] of Object.entries(rawHeaders ?? [])) { for (const [name, value] of Object.entries(rawHeaders ?? [])) {
headers.push({ if (!Object.is(value, undefined)) {
name: name.toLowerCase(), headers.push({
value: { name: name.toLowerCase(),
type: 'string', value: {
value: String(value), type: 'string',
}, value: String(value),
}); },
});
}
} }
return headers; return headers;