diff options
author | Micael Karlberg <[email protected]> | 2012-03-15 11:59:40 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2012-03-15 11:59:40 +0100 |
commit | a366623c674e993667fedbe01ad52dc4fab5b4f0 (patch) | |
tree | f377605e6270ad279cfe48253b8ae84b5c99b951 /lib/inets/src/http_client/httpc_manager.erl | |
parent | 0c11d7235ed1f0f5c595cf3d9a433adf9c61cc8c (diff) | |
download | otp-a366623c674e993667fedbe01ad52dc4fab5b4f0.tar.gz otp-a366623c674e993667fedbe01ad52dc4fab5b4f0.tar.bz2 otp-a366623c674e993667fedbe01ad52dc4fab5b4f0.zip |
[inets] The module http_uri now officially supported
The module http_uri now officially supported.
Also, the http_uri:parse/1,2 function has been
extended with more scheme support and a way
to provide your own scheme info.
OTP-9983
Diffstat (limited to 'lib/inets/src/http_client/httpc_manager.erl')
-rw-r--r-- | lib/inets/src/http_client/httpc_manager.erl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/inets/src/http_client/httpc_manager.erl b/lib/inets/src/http_client/httpc_manager.erl index 33b5dfe046..b225b43214 100644 --- a/lib/inets/src/http_client/httpc_manager.erl +++ b/lib/inets/src/http_client/httpc_manager.erl @@ -446,7 +446,7 @@ handle_call(which_cookies, _, #state{cookie_db = CookieDb} = State) -> handle_call({which_cookies, Url, Options}, _, #state{cookie_db = CookieDb} = State) -> ?hcrv("which cookies", [{url, Url}, {options, Options}]), - case http_uri:parse(Url, Options) of + case uri_parse(Url, Options) of {ok, {Scheme, _, Host, Port, Path, _}} -> CookieHeaders = httpc_cookie:header(CookieDb, Scheme, {Host, Port}, Path), @@ -894,6 +894,19 @@ make_db_name(ProfileName, Post) -> list_to_atom(atom_to_list(ProfileName) ++ Post). +%%-------------------------------------------------------------------------- +%% These functions is just simple wrappers to parse specifically HTTP URIs +%%-------------------------------------------------------------------------- + +scheme_defaults() -> + [{http, 80}, {https, 443}]. + +uri_parse(URI, Opts) -> + http_uri:parse(URI, [{scheme_defaults, scheme_defaults()} | Opts]). + + +%%-------------------------------------------------------------------------- + call(ProfileName, Msg) -> Timeout = infinity, |