I am collecting URLs from visitors of my site that I then (on-demand) request from my backend. However, I have gotten stuck on the validation of the URL.
A URL is safe to request when:
- It is a valid URL
- It is unambiguous (in RFC 1918 terms, it is public)
What I have found so far:
- The URL interface (validates URLs)
- The ipaddr.js library (validates IPs)
- The is-valid-domain library (Looks to be broken, since it returns true for 256.256.256.256)
However, none of these seems to do what I need it to - not even a combination of them does.
Is there anything I have overlooked?