test: updated for each to for of in test file

PR-URL: https://github.com/nodejs/node/pull/50308
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
lyannel 2024-05-11 11:48:23 -07:00 committed by GitHub
parent bd323b62ea
commit cbc88b6d2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,