From 26af72899417525dd32372d63c07ee5aa1ab6c5c Mon Sep 17 00:00:00 2001 From: Ouyang Yadong Date: Sun, 30 Sep 2018 18:17:36 +0800 Subject: dns: deprecate passing falsy hostname to dns.lookup We can `dns.lookup` a falsy `hostname` like `dns.lookup(false)` for the reason of backwards compatibility long before(see #13119 for detail). This behavior is undocumented and seems useless in real world apps. We could also make invalid `hostname` throw in the future and the change might be semver-major. Fixes: https://github.com/nodejs/node/issues/13119 PR-URL: https://github.com/nodejs/node/pull/23173 Reviewed-By: Anna Henningsen Reviewed-By: Denys Otrishko Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- doc/api/deprecations.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'doc/api/deprecations.md') diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index dc12efb906..ca23a4fa32 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2214,6 +2214,22 @@ the `_handle` property of the `Cipher`, `Decipher`, `DiffieHellman`, Using the `_handle` property to access the native object is deprecated because improper use of the native object can lead to crashing the application. + +### DEP0118: dns.lookup() support for a falsy hostname + + +Type: Runtime + +Previous versions of Node.js supported `dns.lookup()` with a falsy hostname +like `dns.lookup(false)` due to backward compatibility. +This behavior is undocumented and is thought to be unused in real world apps. +It will become an error in future versions of Node.js. + [`--pending-deprecation`]: cli.html#cli_pending_deprecation [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size [`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array -- cgit v1.2.3