URI.parse and the 7x http:// URL

Interesting read indeed!

Elixir implements RFC 3986, so we should parse it accordingly to that, and not to curl. A quick check shows we align with RFC 3986 and its reference regex. :slight_smile:

But you did find a related bug:

iex(2)> URI.new "http://http://http://@http://http://?http://#http://"
{:ok,
 %URI{
   scheme: "http",
   userinfo: nil,
   host: "http",
   port: :undefined,
   path: "//http://@http://http://",
   query: "http://",
   fragment: "http://"
 }}

Notice the :undefined. :slight_smile:

6 Likes