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

Why is 127.0.0.1 not marked as reserved? #117

Closed
joekaiser opened this issue Sep 3, 2020 · 4 comments
Closed

Why is 127.0.0.1 not marked as reserved? #117

joekaiser opened this issue Sep 3, 2020 · 4 comments
Labels

Comments

@joekaiser
Copy link

Evaluating localhost returns { type: 'RESERVED', hostname: 'localhost', labels: [ 'localhost' ] }

but evaluating 127.0.0.1 returns { type: 'IP', hostname: '127.0.0.1', ipVersion: 4 }

Although technically true, shouldn't reserved IP address be marked as such?

@joekaiser
Copy link
Author

https://www.npmjs.com/package/ip-range-check

What I did is use the package above to determine if an IP is reserved. It is really simple when used in conjunction with parse-domain

@jhnns jhnns closed this as completed in cc45487 Oct 18, 2020
@jhnns
Copy link
Member

jhnns commented Oct 18, 2020

Thanks for asking 😀. Parsing and evaluating IPs is out of scope for parse-domain. I added a note to the README.

@github-actions
Copy link

🎉 This issue has been resolved in version 3.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@joekaiser
Copy link
Author

That makes sense. It is easy enough to take the list of reserved IPs from wikipedia and use the ip-range-check package to compare against it. I would argue it is better anyway and keeps this package smaller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants