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);