Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unintentional string concat? #17

Open
jnovack opened this issue Jul 26, 2018 · 1 comment
Open

Unintentional string concat? #17

jnovack opened this issue Jul 26, 2018 · 1 comment

Comments

@jnovack
Copy link

jnovack commented Jul 26, 2018

Is this intentional?

Every field is being concat'd rather than a separate entry. This only occurs when there is no recursive query (the query to whois.arin.net resolves without asking another server).

I am expecting an initial ATT object at results[0] and a secondary ALASCOM object at results[1].

$ node index.js 12.12.12.12
[
  {
    "server": {
      "host": "whois.arin.net",
      "query": "n + $addr\r\n",
      "port": 43
    },
    "data": {
      "availableAt": "https://www.arin.net/whois_tou.html https://www.arin.net/whois_tou.html",
      "netRange": "12.12.0.0 - 12.12.127.255 12.0.0.0 - 12.255.255.255",
      "cidr": "12.12.0.0/17 12.0.0.0/8",
      "netName": "ALASCOM-12-0 ATT",
      "netHandle": "NET-12-12-0-0-1 NET-12-0-0-0-1",
      "parent": "ATT (NET-12-0-0-0-1) NET12 (NET-12-0-0-0-0)",
      "netType": "Reallocated Direct Allocation",
      "organization": "Alascom, Inc. (ALAS) AT&T Services, Inc. (ATTW-Z)",
      "regDate": "1998-04-21 1998-04-21 1983-08-22 2009-12-18",
      "updated": "2006-06-07 2009-10-01 2013-12-19 2018-01-16",
      "ref": "https://rdap.arin.net/registry/ip/12.12.0.0 https://rdap.arin.net/registry/entity/ALAS https://rdap.arin.net/registry/ip/12.0.0.0 https://rdap.arin.net/registry/entity/ATTW-Z",
      "orgName": "Alascom, Inc. AT&T Services, Inc.",
      "orgId": "ALAS ATTW-Z",
      "address": "505 E Bluff Dr 200 S. Laurel AVE.",
      "city": "Anchorage MIDDLETOWN",
      "stateProv": "AK NJ",
      "postalCode": "99501 07748",
      "country": "US US",
     ....
    }
  }
]
$ cat index.js
const whois = require('whois-json');
(async function(){
    if (process.argv[2] && process.argv[2].match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)) {
        console.log(process.argv[2]);
        var results = await whois(process.argv[2], {follow: 3, verbose: true});
        console.log(JSON.stringify(results, null, 2));
    }
})()
$ node -v
v8.11.3
@jnovack
Copy link
Author

jnovack commented Jul 26, 2018

This may be a side effect of #3 and #4.

@jnovack jnovack mentioned this issue Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant