From a4d41bd2fe09ccb84cae78fd2c52023cf527e17b Mon Sep 17 00:00:00 2001 From: Jonathan Ong Date: Sat, 24 Jan 2015 10:39:28 -0800 Subject: [PATCH] http: replace util._extend() with Object.create() `options` is never touched, so there's no need to make a copy. Anyways, a better alternative for making copies is to just `Object.create()` the object. An alternative solution is to not bother copying at all. This solves issues such as https://github.com/petkaantonov/urlparser/issues where the `options` object is created from a constructor. --- lib/_http_client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/_http_client.js b/lib/_http_client.js index 96b8ce57b1e50e..14b1a8298927d1 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -22,7 +22,7 @@ function ClientRequest(options, cb) { if (util.isString(options)) { options = url.parse(options); } else { - options = util._extend({}, options); + options = Object.create(options); } var agent = options.agent;