net: shallow copy option when create Server
PR-URL: https://github.com/nodejs/node/pull/28924 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
aa252ebf66
commit
d53035488c
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user