From 3be6374f91e8f2bf8cb655e2b8023c5e538c0a35 Mon Sep 17 00:00:00 2001 From: zhanghongtong Date: Thu, 9 Sep 2021 10:53:59 +0800 Subject: [PATCH] fix(auth mnesia api): fix get file type error --- apps/emqx_authz/src/emqx_authz_api_sources.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/emqx_authz/src/emqx_authz_api_sources.erl b/apps/emqx_authz/src/emqx_authz_api_sources.erl index 4be631560..df62a418a 100644 --- a/apps/emqx_authz/src/emqx_authz_api_sources.erl +++ b/apps/emqx_authz/src/emqx_authz_api_sources.erl @@ -304,7 +304,7 @@ sources(get, _) -> {ok, Rules} = file:consult(Path), lists:append(AccIn, [#{type => file, enable => true, - rules => [ io_lib:format("~p", [R])|| R <- Rules], + rules => [ iolist_to_binary(io_lib:format("~p", [R])) || R <- Rules], annotations => #{status => healthy} }]); (#{type := _Type, annotations := #{id := Id}} = Source, AccIn) -> @@ -372,7 +372,7 @@ source(get, #{bindings := #{type := Type}}) -> {ok, Rules} = file:consult(Path), {200, #{type => file, enable => true, - rules => Rules, + rules => [ iolist_to_binary(io_lib:format("~p", [R])) || R <- Rules], annotations => #{status => healthy} } };