summaryrefslogtreecommitdiff
path: root/lib/net.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-03-18 19:35:59 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2019-03-25 16:13:33 +0100
commit96204c3c71f6cc571be56269ba9d584d615f0a06 (patch)
treec94b0df91cfb30602486ebd288d14aef57a2d021 /lib/net.js
parentbdea725bdcb299579547f66ebcc98af16f53cd16 (diff)
downloadandroid-node-v8-96204c3c71f6cc571be56269ba9d584d615f0a06.tar.gz
android-node-v8-96204c3c71f6cc571be56269ba9d584d615f0a06.tar.bz2
android-node-v8-96204c3c71f6cc571be56269ba9d584d615f0a06.zip
net: do not manipulate potential user code
The error provided in this function could come from user code. Thus the error should not be manipulated in any way. The added properties do not seem to provide any actual value either as can not be part of the error. The `hostname` is already set on the error and adding the `host` property with the identical value does not seem right in this case. PR-URL: https://github.com/nodejs/node/pull/26751 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'lib/net.js')
-rw-r--r--lib/net.js6
1 files changed, 0 insertions, 6 deletions
diff --git a/lib/net.js b/lib/net.js
index a5f012ac33..d5a7ba6371 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -971,12 +971,6 @@ function lookupAndConnect(self, options) {
// net.createConnection() creates a net.Socket object and immediately
// calls net.Socket.connect() on it (that's us). There are no event
// listeners registered yet so defer the error event to the next tick.
- // TODO(BridgeAR): The error could either originate from user code or
- // by the C++ layer. The port is never the cause for the error as it is
- // not used in the lookup. We should probably just remove this.
- err.host = options.host;
- err.port = options.port;
- err.message = err.message + ' ' + options.host + ':' + options.port;
process.nextTick(connectErrorNT, self, err);
} else if (addressType !== 4 && addressType !== 6) {
err = new ERR_INVALID_ADDRESS_FAMILY(addressType,