mirror of
https://github.com/processone/ejabberd.git
synced 2025-01-03 18:02:28 +01:00
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.
This commit is contained in:
parent
77308e6aff
commit
9ea51d3295
@ -62,6 +62,8 @@ uri_parse(URL) ->
|
|||||||
{ok, {Scheme, _UserInfo, Host, Port, Path, _Query}} = http_uri:parse(URL),
|
{ok, {Scheme, _UserInfo, Host, Port, Path, _Query}} = http_uri:parse(URL),
|
||||||
{ok, Scheme, Host, Port, Path}.
|
{ok, Scheme, Host, Port, Path}.
|
||||||
-else.
|
-else.
|
||||||
|
uri_parse(URL) when is_binary(URL) ->
|
||||||
|
uri_parse(binary_to_list(URL));
|
||||||
uri_parse(URL) ->
|
uri_parse(URL) ->
|
||||||
#{scheme:=Scheme,host:=Host,port:=Port,path:=Path} = uri_string:parse(URL),
|
#{scheme:=Scheme,host:=Host,port:=Port,path:=Path} = uri_string:parse(URL),
|
||||||
{ok, Scheme, Host, Port, Path}.
|
{ok, Scheme, Host, Port, Path}.
|
||||||
|
Loading…
Reference in New Issue
Block a user