aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2016-03-15 10:13:16 +0100
committerIngela Anderton Andin <[email protected]>2016-03-16 11:14:58 +0100
commit640a6cd4f9cdc145afa26809834034ec4e3d2f94 (patch)
tree797554e246689f323754d689ec02261a4b2487f9 /lib/inets/src
parentd9318b579b555372cd86b4b11a50af9d46c7bb5d (diff)
downloadotp-640a6cd4f9cdc145afa26809834034ec4e3d2f94.tar.gz
otp-640a6cd4f9cdc145afa26809834034ec4e3d2f94.tar.bz2
otp-640a6cd4f9cdc145afa26809834034ec4e3d2f94.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')
-rw-r--r--lib/inets/src/http_client/httpc.erl6
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 85663b5ded..4554881d79 100644
--- a/lib/inets/src/http_client/httpc.erl
+++ b/lib/inets/src/http_client/httpc.erl
@@ -556,7 +556,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,
@@ -1268,3 +1268,7 @@ child_name(Pid, [_ | Children]) ->
%% d(_, _, _) ->
%% ok.
+host_address(Host, false) ->
+ Host;
+host_address(Host, true) ->
+ string:strip(string:strip(Host, right, $]), left, $[).