Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,13 +152,11 @@ exports.request = function (options, callback) { | |
if (!options.encoding && options.encoding !== null) { | ||
options.encoding = 'utf8'; | ||
} | ||
if (options.encoding) { | ||
encoding = options.encoding; | ||
if (encoding === 'ascii') { | ||
options['use-ascii'] = true; | ||
} | ||
delete options.encoding; | ||
encoding = options.encoding; | ||
if (encoding === 'ascii') { | ||
options['use-ascii'] = true; | ||
} | ||
delete options.encoding; | ||
|
||
//Parse POST data | ||
if (options.data && typeof options.data === 'object') { | ||
|
@@ -388,7 +386,7 @@ exports.copy = function (obj) { | |
var copy = {}; | ||
for (var i in obj) { | ||
if (typeof obj[i] === 'object') { | ||
copy[i] = exports.copy(obj[i]); | ||
copy[i] = copy[i] ? exports.copy(obj[i]) : null; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
chriso
Author
Contributor
|
||
} else { | ||
copy[i] = obj[i]; | ||
} | ||
|
Silly question - it seems that this will take every property that is assigned a falsy value and mis-assign it to null instead.
Thus, an object like this:
Will become this:
Or do I need more caffeine .... ?