fix(emqx_coap): handle invalid query string in parse

This commit is contained in:
firest 2022-01-26 11:08:12 +08:00
parent 05d6c40717
commit a544f162c9
1 changed files with 6 additions and 3 deletions

View File

@ -266,9 +266,12 @@ parse(<<?VERSION:2, Type:2, TKL:4, Class:3, Code:5, MsgId:16, Token:TKL/binary,
get_option_val(uri_query, V) ->
KVList = lists:foldl(fun(E, Acc) ->
[Key, Val] = re:split(E, "="),
[{Key, Val} | Acc]
case re:split(E, "=") of
[Key, Val] ->
[{Key, Val} | Acc];
_ ->
Acc
end
end,
[],
V),