From ca4b1ca3b58f1b83583c7c809c4364db0fbf30d8 Mon Sep 17 00:00:00 2001 From: zhanghongtong Date: Tue, 14 Sep 2021 16:38:39 +0800 Subject: [PATCH] fix(auth mnesia api): fix the issue of missing line breaks in multi-line rules --- 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 19d229dc2..cad968bd6 100644 --- a/apps/emqx_authz/src/emqx_authz_api_sources.erl +++ b/apps/emqx_authz/src/emqx_authz_api_sources.erl @@ -302,7 +302,7 @@ sources(get, _) -> {ok, Rules} -> lists:append(AccIn, [#{type => file, enable => Enable, - rules => iolist_to_binary([io_lib:format("~p.", [R]) || R <- Rules]), + rules => iolist_to_binary([io_lib:format("~p.\n", [R]) || R <- Rules]), annotations => #{status => healthy} }]); {error, _} -> @@ -360,7 +360,7 @@ source(get, #{bindings := #{type := Type}}) -> {ok, Rules} -> {200, #{type => file, enable => Enable, - rules => iolist_to_binary([io_lib:format("~p.", [R]) || R <- Rules]), + rules => iolist_to_binary([io_lib:format("~p.\n", [R]) || R <- Rules]), annotations => #{status => healthy} } };