diff options
author | Ingela Anderton Andin <[email protected]> | 2016-03-15 10:13:16 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2016-03-17 10:13:40 +0100 |
commit | e106e418efebbdd7c18b37a0025463b3d625513a (patch) | |
tree | 49049a6150d6f26fb855f77bb85fb66a588eefd6 /lib/inets/src/http_client/httpc.erl | |
parent | d646221c59fbf57d5beac913248b46f5dbebfbe7 (diff) | |
download | otp-e106e418efebbdd7c18b37a0025463b3d625513a.tar.gz otp-e106e418efebbdd7c18b37a0025463b3d625513a.tar.bz2 otp-e106e418efebbdd7c18b37a0025463b3d625513a.zip |
inets: Mend ipv6_host_with_brackets option
This is a quick fix to make this option work.
We will revisit this and clean up httpc option handling later.
Also adding regression tests.
Diffstat (limited to 'lib/inets/src/http_client/httpc.erl')
-rw-r--r-- | lib/inets/src/http_client/httpc.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl index e4a6f8f748..d4dfbfbd89 100644 --- a/lib/inets/src/http_client/httpc.erl +++ b/lib/inets/src/http_client/httpc.erl @@ -555,7 +555,7 @@ handle_request(Method, Url, Request = #request{from = Receiver, scheme = Scheme, - address = {Host, Port}, + address = {host_address(Host, BracketedHost), Port}, path = MaybeEscPath, pquery = MaybeEscQuery, method = Method, @@ -1267,3 +1267,7 @@ child_name(Pid, [_ | Children]) -> %% d(_, _, _) -> %% ok. +host_address(Host, false) -> + Host; +host_address(Host, true) -> + string:strip(string:strip(Host, right, $]), left, $[). |