Currently the URL parser can handle hostnames, IP addresses, etc.
> new URL('http://127.0.0.1')
URL { href: "http://127.0.0.1/", origin: "http://127.0.0.1", protocol: "http:", username: "", password: "", host: "127.0.0.1", hostname: "127.0.0.1", port: "", pathname: "/", hash: "", search: "" }
Unfortunately, when using IPv6 addresses in URLs, the hostname is parsed as [, which means the remaining part is treated as a port (and therefore invalid)
> new URL('http://[::1]')
Uncaught TypeError: Invalid URL.
at new URLImpl ($deno$/web/url.ts:418:13)
at <unknown>:1:1
at evaluate ($deno$/repl.ts:45:34)
at Object.replLoop ($deno$/repl.ts:136:13)
This has also caused an (uncaught) error in Oak when a URL is accessed by IPv6 address directly, and the same may be true for other applications.
Will submit a PR shortly
Most helpful comment
Will submit a PR shortly