We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7859c2 commit 44c0e4fCopy full SHA for 44c0e4f
lib/_http_client.js
@@ -122,7 +122,8 @@ function ClientRequest(options, cb) {
122
self.once('response', cb);
123
}
124
125
- if (!Array.isArray(options.headers)) {
+ var headersArray = Array.isArray(options.headers);
126
+ if (!headersArray) {
127
if (options.headers) {
128
var keys = Object.keys(options.headers);
129
for (var i = 0, l = keys.length; i < l; i++) {
@@ -166,7 +167,7 @@ function ClientRequest(options, cb) {
166
167
self.useChunkedEncodingByDefault = true;
168
169
- if (Array.isArray(options.headers)) {
170
+ if (headersArray) {
171
self._storeHeader(self.method + ' ' + self.path + ' HTTP/1.1\r\n',
172
options.headers);
173
} else if (self.getHeader('expect')) {
0 commit comments