fix(coap): Ensure that the retain flag is a boolean value
This commit is contained in:
parent
60492615ba
commit
3cc76c0adf
|
@ -121,7 +121,13 @@ apply_publish_opts(Msg, MQTTMsg) ->
|
||||||
maps:fold(
|
maps:fold(
|
||||||
fun
|
fun
|
||||||
(<<"retain">>, V, Acc) ->
|
(<<"retain">>, V, Acc) ->
|
||||||
Val = erlang:binary_to_atom(V),
|
Val =
|
||||||
|
case emqx_misc:safe_to_existing_atom(V) of
|
||||||
|
{ok, true} ->
|
||||||
|
true;
|
||||||
|
_ ->
|
||||||
|
false
|
||||||
|
end,
|
||||||
emqx_message:set_flag(retain, Val, Acc);
|
emqx_message:set_flag(retain, Val, Acc);
|
||||||
(<<"expiry">>, V, Acc) ->
|
(<<"expiry">>, V, Acc) ->
|
||||||
Val = erlang:binary_to_integer(V),
|
Val = erlang:binary_to_integer(V),
|
||||||
|
|
Loading…
Reference in New Issue