summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlosEDP <me@carlosedp.com>2015-07-02 11:59:00 -0300
committerCarlosEDP <me@carlosedp.com>2015-07-03 16:40:28 -0300
commit38cc32c40afdf8e999d8705501acd7e13918cdc9 (patch)
treea62ee132b9db7248cbb61116675936d515108c8b /src
parent46ca2bb6b0e9c99c7a5b4efb7b9efc310c0982b8 (diff)
Added rebar profile to httpc initialization and calls.
Diffstat (limited to 'src')
-rw-r--r--src/rebar3.erl3
-rw-r--r--src/rebar_pkg_resource.erl3
-rw-r--r--src/rebar_prv_update.erl3
-rw-r--r--src/rebar_utils.erl2
4 files changed, 7 insertions, 4 deletions
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).