Skip to content

Commit d5a21a2

Browse files
committed
getaddrinfo returns ENOTFOUND for invalid domain names
change test-http-dns-error to reflect this.
1 parent efa95c2 commit d5a21a2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/dns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function errnoException(errorno, syscall) {
3232

3333
// For backwards compatibility. libuv returns ENOENT on NXDOMAIN.
3434
if (errorno == 'ENOENT') {
35-
errorno = 'EBADNAME'
35+
errorno = 'ENOTFOUND'
3636
}
3737

3838
e.errno = e.code = errorno;

test/simple/test-http-dns-error.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ function test(mod) {
4646
// Ensure that there is time to attach an error listener.
4747
var req = mod.get({host: host, port: 42}, do_not_call);
4848
req.on('error', function(err) {
49-
assert.equal(err.code, 'EBADNAME');
49+
assert.equal(err.code, 'ENOTFOUND');
5050
actual_bad_requests++;
5151
});
5252
// http.get() called req.end() for us
5353

5454
var req = mod.request({method: 'GET', host: host, port: 42}, do_not_call);
5555
req.on('error', function(err) {
56-
assert.equal(err.code, 'EBADNAME');
56+
assert.equal(err.code, 'ENOTFOUND');
5757
actual_bad_requests++;
5858
});
5959
req.end();

0 commit comments

Comments
 (0)