shamblett / coap

A Coap package for dart
Other
16 stars 13 forks source link

fix: fix parsing of empty tokens #135

Closed JKRhb closed 1 year ago

JKRhb commented 1 year ago

As uncovered in #132, there is currently a bug when it comes to the CoAP Ping example, introduced by #127. After doing some research, I noticed that this is caused by an incorrect handling of empty message tokens, which are currently identified as invalid. This PR applies a simple fix by returning an empty buffer if a token length of zero should be encountered, resolving not only the ping issue but also other unintended side effects.