Merge pull request #6862 from lafirest/fix/coap

fix(emqx_coap): handle invalid query string in parse
This commit is contained in:
lafirest 2022-01-26 14:30:50 +08:00 committed by GitHub
commit 2522a36b0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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),