-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support httpc profile through adapter configs #36
Conversation
src/hex_http_httpc.erl
Outdated
|
||
%%==================================================================== | ||
%% API functions | ||
%%==================================================================== | ||
|
||
request(Method, URI, ReqHeaders, Body) -> | ||
request(Method, URI, ReqHeaders, Body, Options) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: could you rename Options to AdapterConfig here and elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, will do.
src/hex_http.erl
Outdated
@@ -9,8 +9,9 @@ | |||
-type status() :: non_neg_integer(). | |||
-type headers() :: #{binary() => binary()}. | |||
-type body() :: nil. | |||
-type adapter_config() :: maps:map(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity, is there a difference between map()
and maps:map()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Na. maps:map()
probably is just -type map() :: maps().
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually looks like there's no such type, let's go with just map()
:)
iex> t :maps
@opaque iterator()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh weird... ok, fixing up.
d1e7fa1
to
dcb20b9
Compare
dcb20b9
to
55794ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💜
I wonder if we should document how to set up a profile with proxy settings? I would guess most using hex_core would want this. |
Yeah it wouldn't necessarily be very hard, rebar3 does it in probably ~50 lines of code. The values are parsed off the env with: https://github.com/erlang/rebar3/blob/416176290b20e1e68c5901f83cccef71ec2bc322/src/rebar_utils.erl#L840-L867 The values are set and get with https://github.com/erlang/rebar3/blob/416176290b20e1e68c5901f83cccef71ec2bc322/src/rebar_utils.erl#L910-L922 And used at the call-site as: https://github.com/erlang/rebar3/blob/416176290b20e1e68c5901f83cccef71ec2bc322/src/rebar_pkg_resource.erl#L128-L133 There's some additional complexity by using a |
Thank you! Good idea about updating docs with a howto, we can work on that separately. |
No description provided.