diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2020-06-03 12:02:29 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2020-06-03 12:02:29 +0200 |
commit | 9ea51d3295b19dfd4e4eaf79f9712c42e2d08d27 (patch) | |
tree | 1a8d27f21b2ebc6c5d1418f61281c6086ea7d801 /src | |
parent | Merge remote-tracking branch 'processone/pr/3294' (diff) |
misc: Make sure uri_parse/1 returns strings
The uri_string:parse/1 function returns the URI elements as strings or
as binaries depending on the input. Make sure misc:uri_parse/1 returns
strings in both cases, analogous to the behavior when USE_OLD_HTTP_URI
is defined.
Diffstat (limited to 'src')
-rw-r--r-- | src/misc.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/misc.erl b/src/misc.erl index c91809015..2574c005a 100644 --- a/src/misc.erl +++ b/src/misc.erl @@ -62,6 +62,8 @@ uri_parse(URL) -> {ok, {Scheme, _UserInfo, Host, Port, Path, _Query}} = http_uri:parse(URL), {ok, Scheme, Host, Port, Path}. -else. +uri_parse(URL) when is_binary(URL) -> + uri_parse(binary_to_list(URL)); uri_parse(URL) -> #{scheme:=Scheme,host:=Host,port:=Port,path:=Path} = uri_string:parse(URL), {ok, Scheme, Host, Port, Path}. |