From d569cde51f02311f40c1c899a2937ade172bcad2 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Sun, 23 Jun 2024 18:51:34 +0200 Subject: [PATCH] merge headers --- lib/firefox/firefoxBidi.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/firefox/firefoxBidi.js b/lib/firefox/firefoxBidi.js index 3f1e08d78..89c3c4fcd 100644 --- a/lib/firefox/firefoxBidi.js +++ b/lib/firefox/firefoxBidi.js @@ -176,8 +176,7 @@ export class FirefoxBidi { }; const bidi = new Bidi(this.driver, this.options.browser); - const res = await bidi.send(command); - log.info(res); + await bidi.send(command); await bidi.subscribe('network.beforeRequestSent'); await bidi.onMessage(async function (event) { const parsedEvent = JSON.parse(Buffer.from(event.toString())); @@ -186,17 +185,13 @@ export class FirefoxBidi { method: 'network.continueRequest', params: { request: parsedEvent.params.request.request, - headers + headers: [...parsedEvent.params.request.headers, ...headers] } }; const result = await bidi.send(continueRequest); - if (result.type == 'success') { - log.info(result); - } else { + if (result.type != 'success') { log.error(result); } - } else { - log.info(parsedEvent.method); } }); }