From 175e1fa414b6609e83da2d4b3ab44bbdca754ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Dimitrov?= Date: Mon, 27 Nov 2017 16:42:14 +0100 Subject: inets: Fix httpc path handling Fixed handling of URL paths that contain space (%20) characters. Change-Id: Ic09691e35c70ee005af7637a6ec3ae588097bec1 --- lib/inets/src/http_client/httpc.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/inets/src') diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl index 2efe2c2858..821eb7f02f 100644 --- a/lib/inets/src/http_client/httpc.erl +++ b/lib/inets/src/http_client/httpc.erl @@ -319,7 +319,7 @@ store_cookies(SetCookieHeaders, Url, Profile) Scheme = scheme_to_atom(maps:get(scheme, URI, '')), Host = maps:get(host, URI, ""), Port = maps:get(port, URI, default_port(Scheme)), - Path = maps:get(path, URI, ""), + Path = uri_string:recompose(#{path => maps:get(path, URI, "")}), %% Since the Address part is not actually used %% by the manager when storing cookies, we dont %% care about ipv6-host-with-brackets. @@ -539,7 +539,7 @@ handle_request(Method, Url, Host = http_util:maybe_add_brackets(maps:get(host, URI, ""), BracketedHost), Port = maps:get(port, URI, default_port(Scheme)), Host2 = http_request:normalize_host(Scheme, Host, Port), - Path = maps:get(path, URI, ""), + Path = uri_string:recompose(#{path => maps:get(path, URI, "")}), Query = add_question_mark(maps:get(query, URI, "")), HeadersRecord = header_record(NewHeaders, Host2, HTTPOptions), -- cgit v1.2.3