diff --git a/lib/request.js b/lib/request.js
index <HASH>..<HASH> 100644
--- a/lib/request.js
+++ b/lib/request.js
@@ -97,11 +97,7 @@ class Request extends AsyncResource {
       let header = `${method} ${path} HTTP/1.1\r\nconnection: keep-alive\r\n`
 
       if (headers) {
-        const headerNames = Object.keys(headers)
-        for (let i = 0; i < headerNames.length; i++) {
-          const key = headerNames[i]
-          const val = headers[key]
-
+        for (const [key, val] of Object.entries(headers)) {
           if (typeof val === 'object') {
             throw new InvalidArgumentError(`invalid ${key} header`)
           } else if (val === undefined) {
refactor: prefer for of loop