elixir-lang/elixir — pull request #2636 by voltone (2014-08-06 19:00:39+00:00)
Title: Improved RFC compliance for URI to_string

URI.parse works according to RFC 3986 Appendix B, but to_string is a simplification that can lead to illegal URIs. In particular, it does not handle URIs without a schema (e.g. "//example.net/path") correctly.

Compare Elixir 0.15.0:

```
iex(1)> to_string URI.parse("//example.net/path")
"example.net/path"
```

To Ruby:

```
irb :001 > URI.parse("//example.net/path").to_s
=> "//example.net/path"
```

This PR implements the URI recomposition according to section 5.3 of the RFC.