From 96f27db2f79f6491b5279d1bda8c2661b87ccf77 Mon Sep 17 00:00:00 2001 From: himself65 Date: Thu, 1 Aug 2019 16:12:57 +0800 Subject: [PATCH] net: shallow copy option when create Server --- lib/net.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index 94b4e2a86cbed0..09e34f75bd01f2 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1078,7 +1078,7 @@ function Server(options, connectionListener) { options = {}; this.on('connection', connectionListener); } else if (options == null || typeof options === 'object') { - options = options || {}; + options = { ...options }; if (typeof connectionListener === 'function') { this.on('connection', connectionListener);