aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_lib
diff options
context:
space:
mode:
authorLuca Favatella <[email protected]>2018-03-05 11:05:34 +0000
committerLuca Favatella <[email protected]>2018-03-05 11:36:17 +0000
commit81dc712abfc5e93d996191178e555d0c6af3652d (patch)
tree14406681f03e1f27aedae6ae63ee4cd7f47cd36b /lib/inets/src/http_lib
parent27cfa1da6d35674f6cd169b103385a09c8d4c55a (diff)
downloadotp-81dc712abfc5e93d996191178e555d0c6af3652d.tar.gz
otp-81dc712abfc5e93d996191178e555d0c6af3652d.tar.bz2
otp-81dc712abfc5e93d996191178e555d0c6af3652d.zip
inets: refine types and doc of http_uri:parse options
Diffstat (limited to 'lib/inets/src/http_lib')
-rw-r--r--lib/inets/src/http_lib/http_uri.erl13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/inets/src/http_lib/http_uri.erl b/lib/inets/src/http_lib/http_uri.erl
index 648bd0538a..3bada84357 100644
--- a/lib/inets/src/http_lib/http_uri.erl
+++ b/lib/inets/src/http_lib/http_uri.erl
@@ -81,13 +81,15 @@
-type hex_uri() :: string() | binary(). %% Hexadecimal encoded URI.
-type maybe_hex_uri() :: string() | binary(). %% A possibly hexadecimal encoded URI.
+-type scheme_defaults() :: [{scheme(), default_scheme_port_number()}].
+-type scheme_validation_fun() :: fun((SchemeStr :: string() | binary()) ->
+ valid | {error, Reason :: term()}).
+
%%%=========================================================================
%%% API
%%%=========================================================================
--spec scheme_defaults() ->
- [{scheme(), default_scheme_port_number()}].
-
+-spec scheme_defaults() -> scheme_defaults().
scheme_defaults() ->
[{http, 80},
{https, 443},
@@ -106,7 +108,10 @@ parse(AbsURI) ->
parse(AbsURI, []).
-spec parse(uri(), [Option]) -> {ok, parse_result()} | {error, term()} when
- Option :: {atom(), term()}.
+ Option :: {ipv6_host_with_brackets, boolean()} |
+ {scheme_defaults, scheme_defaults()} |
+ {fragment, boolean()} |
+ {scheme_validation_fun, scheme_validation_fun()}.
parse(AbsURI, Opts) ->
case parse_scheme(AbsURI, Opts) of
{error, Reason} ->