fix: get plugin config in json

This commit is contained in:
JimMoen 2024-04-25 13:43:00 +08:00
parent d2ecccc2ff
commit f343cd2021
No known key found for this signature in database
1 changed files with 3 additions and 3 deletions

View File

@ -486,9 +486,9 @@ update_plugin(put, #{bindings := #{name := Name, action := Action}}) ->
return(204, Res).
plugin_config(get, #{bindings := #{name := Name}}) ->
case emqx_plugins:get_plugin_config(Name, #{format => ?CONFIG_FORMAT_AVRO}) of
{ok, AvroBin} ->
{200, #{<<"content-type">> => <<"application/octet-stream">>}, AvroBin};
case emqx_plugins:get_plugin_config(Name, #{format => ?CONFIG_FORMAT_MAP}) of
{ok, AvroJson} ->
{200, #{<<"content-type">> => <<"'application/json'">>}, AvroJson};
{error, _} ->
{400, #{
code => 'BAD_CONFIG',