diff options
-rwxr-xr-x | bootstrap | 8 | ||||
-rw-r--r-- | src/rebar3.erl | 3 | ||||
-rw-r--r-- | src/rebar_pkg_resource.erl | 3 | ||||
-rw-r--r-- | src/rebar_prv_update.erl | 3 | ||||
-rw-r--r-- | src/rebar_utils.erl | 2 |
5 files changed, 12 insertions, 7 deletions
@@ -9,6 +9,8 @@ main(_Args) -> application:start(public_key), application:start(ssl), inets:start(), + inets:start(httpc, [{profile, rebar}]), + set_httpc_options(), %% Fetch and build deps required to build rebar3 BaseDeps = [{providers, []} @@ -82,10 +84,10 @@ extract(Binary) -> {ok, Contents}. request(Url) -> - set_httpc_options(), case httpc:request(get, {Url, []}, [{relaxed, true}], - [{body_format, binary}]) of + [{body_format, binary}], + rebar) of {ok, {{_Version, 200, _Reason}, _Headers, Body}} -> {ok, Body}; Error -> @@ -114,7 +116,7 @@ set_httpc_options(_, []) -> set_httpc_options(Scheme, Proxy) -> {ok, {_, _, Host, Port, _, _}} = http_uri:parse(Proxy), - httpc:set_options([{Scheme, {{Host, Port}, []}}]). + httpc:set_options([{Scheme, {{Host, Port}, []}}], rebar). compile(App, FirstFiles) -> Dir = filename:join(filename:absname("_build/default/lib/"), App), diff --git a/src/rebar3.erl b/src/rebar3.erl index 13f6017..a797c46 100644 --- a/src/rebar3.erl +++ b/src/rebar3.erl @@ -273,5 +273,6 @@ start_and_load_apps() -> application:start(public_key), application:start(ssl), inets:start(), - inets:start(httpc), + inets:start(httpc, [{profile, rebar}]), rebar_utils:set_httpc_options(). + diff --git a/src/rebar_pkg_resource.erl b/src/rebar_pkg_resource.erl index 59ce0dc..450ff1e 100644 --- a/src/rebar_pkg_resource.erl +++ b/src/rebar_pkg_resource.erl @@ -95,7 +95,8 @@ make_vsn(_) -> request(Url, ETag) -> case httpc:request(get, {Url, [{"if-none-match", ETag} || ETag =/= false]}, [{relaxed, true}], - [{body_format, binary}]) of + [{body_format, binary}], + rebar) of {ok, {{_Version, 200, _Reason}, Headers, Body}} -> ?DEBUG("Successfully downloaded ~s", [Url]), {"etag", ETag1} = lists:keyfind("etag", 1, Headers), diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl index 6838bab..64fe65e 100644 --- a/src/rebar_prv_update.erl +++ b/src/rebar_prv_update.erl @@ -43,7 +43,8 @@ do(State) -> Url = rebar_state:get(State, rebar_packages_cdn, "https://s3.amazonaws.com/s3.hex.pm/registry.ets.gz"), {ok, _RequestId} = httpc:request(get, {Url, []}, - [], [{stream, TmpFile}, {sync, true}]), + [], [{stream, TmpFile}, {sync, true}], + rebar), {ok, Data} = file:read_file(TmpFile), Unzipped = zlib:gunzip(Data), ok = file:write_file(HexFile, Unzipped), diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 70741e4..97104ce 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -685,4 +685,4 @@ set_httpc_options(_, []) -> set_httpc_options(Scheme, Proxy) -> {ok, {_, _, Host, Port, _, _}} = http_uri:parse(Proxy), - httpc:set_options([{Scheme, {{Host, Port}, []}}]). + httpc:set_options([{Scheme, {{Host, Port}, []}}], rebar). |