We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9684de commit 6add7f7Copy full SHA for 6add7f7
lib/_http_client.js
@@ -111,7 +111,8 @@ function ClientRequest(options, cb) {
111
self.once('response', cb);
112
}
113
114
- if (!Array.isArray(options.headers)) {
+ var headersArray = Array.isArray(options.headers);
115
+ if (!headersArray) {
116
if (options.headers) {
117
var keys = Object.keys(options.headers);
118
for (var i = 0, l = keys.length; i < l; i++) {
@@ -155,7 +156,7 @@ function ClientRequest(options, cb) {
155
156
self.useChunkedEncodingByDefault = true;
157
158
- if (Array.isArray(options.headers)) {
159
+ if (headersArray) {
160
self._storeHeader(self.method + ' ' + self.path + ' HTTP/1.1\r\n',
161
options.headers);
162
} else if (self.getHeader('expect')) {
0 commit comments