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