Closed facekapow closed 9 years ago
Nevermind, have to test it first. Need to tweak it. Closing and fixing.
@ArielAbreu I think this should be a part of http code that resolves URLs, DNS resolver knows nothing about URLs (or other protocol addresses) and cares only about hostnames.
OK, I found a regex that works no matter what URL you give it. Ex: "http://httpbin.org/ip" -> "httpbin.org" Putting into the code that resolves URLs.
Thank you!
Going to place in runtime-node-net, which is what resolves the IP.
Yep, sounds good.
@ArielAbreu Btw, there is a parse function that can parse URLs, might be simpler than using regex https://nodejs.org/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost
Thanks for the tip. Probably going to use it.
This fix prevents an AssertionError when given a domain including the URL schema (http...). Note: The regex used returns the domain like "www.example.com", i'm sure this is what it expects.