aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_client/httpc.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/inets/src/http_client/httpc.erl')
-rw-r--r--lib/inets/src/http_client/httpc.erl26
1 files changed, 19 insertions, 7 deletions
diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl
index 2c51c2081c..0a30fe1e20 100644
--- a/lib/inets/src/http_client/httpc.erl
+++ b/lib/inets/src/http_client/httpc.erl
@@ -158,7 +158,7 @@ request(Method,
{http_options, HTTPOptions},
{options, Options},
{profile, Profile}]),
- case http_uri:parse(Url, Options) of
+ case uri_parse(Url, Options) of
{error, Reason} ->
{error, Reason};
{ok, ParsedUrl} ->
@@ -179,7 +179,7 @@ request(Method,
{http_options, HTTPOptions},
{options, Options},
{profile, Profile}]),
- case http_uri:parse(Url, Options) of
+ case uri_parse(Url, Options) of
{error, Reason} ->
{error, Reason};
{ok, ParsedUrl} ->
@@ -328,7 +328,7 @@ store_cookies(SetCookieHeaders, Url, Profile)
%% Since the Address part is not actually used
%% by the manager when storing cookies, we dont
%% care about ipv6-host-with-brackets.
- {ok, {_, _, Host, Port, Path, _}} = http_uri:parse(Url),
+ {ok, {_, _, Host, Port, Path, _}} = uri_parse(Url),
Address = {Host, Port},
ProfileName = profile_name(Profile),
Cookies = httpc_cookie:cookies(SetCookieHeaders, Path, Host),
@@ -585,10 +585,6 @@ maybe_encode_uri(#http_options{url_encode = true}, URI) ->
maybe_encode_uri(_, URI) ->
URI.
-uri_parse(AbsURI) ->
- http_uri:parse(AbsURI, [{scheme_defaults, [{http, 80}, {https, 443}]}]).
-
-
mk_chunkify_fun(ProcessBody) ->
fun(eof_body) ->
eof;
@@ -1202,6 +1198,22 @@ validate_headers(RequestHeaders, _, _) ->
RequestHeaders.
+%%--------------------------------------------------------------------------
+%% These functions is just simple wrappers to parse specifically HTTP URIs
+%%--------------------------------------------------------------------------
+
+scheme_defaults() ->
+ [{http, 80}, {https, 443}].
+
+uri_parse(URI) ->
+ http_uri:parse(URI, [{scheme_defaults, scheme_defaults()}]).
+
+uri_parse(URI, Opts) ->
+ http_uri:parse(URI, [{scheme_defaults, scheme_defaults()} | Opts]).
+
+
+%%--------------------------------------------------------------------------
+
child_name2info(undefined) ->
{error, no_such_service};
child_name2info(httpc_manager) ->