Procházet zdrojové kódy

fix(webhook): convert atom to binary to avoid jiffy encoding failure

JianBo He před 5 roky
rodič
revize
1d241bc39c
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      apps/emqx_web_hook/src/emqx_web_hook.erl

+ 3 - 1
apps/emqx_web_hook/src/emqx_web_hook.erl

@@ -378,8 +378,10 @@ encode_payload(Payload, base62) -> emqx_base62:encode(Payload);
 encode_payload(Payload, base64) -> base64:encode(Payload);
 encode_payload(Payload, plain) -> Payload.
 
-stringfy(Term) when is_atom(Term); is_binary(Term) ->
+stringfy(Term) when is_binary(Term) ->
     Term;
+stringfy(Term) when is_atom(Term) ->
+    atom_to_binary(Term, utf8);
 stringfy(Term) ->
     unicode:characters_to_binary((io_lib:format("~0p", [Term]))).