Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
getaddrinfo returns ENOTFOUND for invalid domain names
Browse files Browse the repository at this point in the history
change test-http-dns-error to reflect this.
  • Loading branch information
ry committed Oct 21, 2011
1 parent efa95c2 commit d5a21a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/dns.js
Expand Up @@ -32,7 +32,7 @@ function errnoException(errorno, syscall) {

// For backwards compatibility. libuv returns ENOENT on NXDOMAIN.
if (errorno == 'ENOENT') {
errorno = 'EBADNAME'
errorno = 'ENOTFOUND'
}

e.errno = e.code = errorno;
Expand Down
4 changes: 2 additions & 2 deletions test/simple/test-http-dns-error.js
Expand Up @@ -46,14 +46,14 @@ function test(mod) {
// Ensure that there is time to attach an error listener.
var req = mod.get({host: host, port: 42}, do_not_call);
req.on('error', function(err) {
assert.equal(err.code, 'EBADNAME');
assert.equal(err.code, 'ENOTFOUND');
actual_bad_requests++;
});
// http.get() called req.end() for us

var req = mod.request({method: 'GET', host: host, port: 42}, do_not_call);
req.on('error', function(err) {
assert.equal(err.code, 'EBADNAME');
assert.equal(err.code, 'ENOTFOUND');
actual_bad_requests++;
});
req.end();
Expand Down

0 comments on commit d5a21a2

Please sign in to comment.