Skip to content

Commit 92702e4

Browse files
author
Daniil Fedotov
committed
Fix runtime parameter formatting.
rabbit_misc:json_encode can return a list or a binary.
1 parent c36be24 commit 92702e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rabbit_runtime_parameters.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
%%
2828
%% The most obvious use case for runtime parameters is policies but
2929
%% there are others:
30-
%%
30+
%%
3131
%% * Plugin-specific parameters that only make sense at runtime,
3232
%% e.g. Federation and Shovel link settings
3333
%% * Exchange and queue decorators
@@ -368,7 +368,7 @@ lookup_component(Component) ->
368368

369369
format(Term) ->
370370
{ok, JSON} = rabbit_misc:json_encode(rabbit_misc:term_to_json(Term)),
371-
list_to_binary(JSON).
371+
iolist_to_binary(JSON).
372372

373373
flatten_errors(L) ->
374374
case [{F, A} || I <- lists:flatten([L]), {error, F, A} <- [I]] of

0 commit comments

Comments
 (0)