Skip to content

Commit a0e8e1c

Browse files
author
José Valim
committed
Further improve URI parse docs
Signed-off-by: José Valim <[email protected]>
1 parent b477dba commit a0e8e1c

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/elixir/lib/uri.ex

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,17 @@ defmodule URI do
274274
defp hex_to_dec(_n), do: throw(:malformed_uri)
275275

276276
@doc """
277-
Parses a URI into components.
277+
Parses a well-formed URI reference into its components.
278278
279-
This parsing is not strict and therefore does not validate the URI.
280-
See the examples section below of how `URI.parse/1` can be used to
281-
parse a wide range of relative URIs.
279+
Note this function expects a well-formed URI and does not perform
280+
any validation. See the examples section below of how `URI.parse/1`
281+
can be used to parse a wide range of relative URIs.
282282
283-
URIs have portions that are handled specially for the particular
284-
scheme of the URI. For example, http and https have different
285-
default ports. Such values can be accessed and registered via
286-
`URI.default_port/1` and `URI.default_port/2`.
283+
This function uses the parsing regular expression as defined
284+
in the Appendix B of RFC3986.
285+
286+
When a URI is given without a port, the values registered via
287+
`URI.default_port/1` and `URI.default_port/2` are used.
287288
288289
## Examples
289290

0 commit comments

Comments
 (0)