Skip to content

Commit 3819911

Browse files
committed
Explicitly mention relative and absolute URIs, closes #10884
1 parent bd38b6e commit 3819911

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/elixir/lib/uri.ex

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -462,14 +462,13 @@ defmodule URI do
462462
defp hex_to_dec(_n), do: throw(:malformed_uri)
463463

464464
@doc """
465-
Parses a well-formed URI reference into its components.
465+
Parses a well-formed URI into its components.
466466
467-
Note this function expects a well-formed URI and does not perform
468-
any validation. See the "Examples" section below for examples of how
469-
`URI.parse/1` can be used to parse a wide range of URIs.
470-
471-
This function uses the parsing regular expression as defined
472-
in [RFC 3986, Appendix B](https://tools.ietf.org/html/rfc3986#appendix-B).
467+
This function can parse both absolute and relative URLs. You can check
468+
if a URI is absolute or relative by checking if the `scheme` field is
469+
nil or not. Furthermore, this function expects both absolute and
470+
relative URIs to be well-formed and does not perform any validation.
471+
See the "Examples" section below.
473472
474473
When a URI is given without a port, the value returned by
475474
`URI.default_port/1` for the URI's scheme is used for the `:port` field.

0 commit comments

Comments
 (0)