diff --git a/test/parallel/test-http-client-default-headers-exist.js b/test/parallel/test-http-client-default-headers-exist.js index 4c49bae8009cd5..cff2370a3124ca 100644 --- a/test/parallel/test-http-client-default-headers-exist.js +++ b/test/parallel/test-http-client-default-headers-exist.js @@ -45,12 +45,12 @@ const server = http.createServer(common.mustCall((req, res) => { `${req.method} was an unexpected method`); const requestHeaders = Object.keys(req.headers); - requestHeaders.forEach((header) => { + for (const header of requestHeaders) { assert.ok( expectedHeaders[req.method].includes(header.toLowerCase()), `${header} should not exist for method ${req.method}` ); - }); + } assert.strictEqual( requestHeaders.length,