shamblett / coap

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

fix: don't set default Accept and Content-Format options #118

Closed JKRhb closed 1 year ago

JKRhb commented 1 year ago

At the moment, both for the Accept and the Content-Format option, a default value of 0 (text/plain; charset=utf-8) is set for requests. This is a bit at odds with the CoAP specification, which assumes no default value for these two options and can lead to unintended side effects if a server rejects certain accept values (but would allow requests with no accept option set).

Therefore, this PR proposes removing the default values from the creation methods, giving full control to the library users.

JosefWN commented 1 year ago

LGTM, just a minor comment.

JKRhb commented 1 year ago

Rebased this PR and #116 to the latest state of master, hope that both PRs can be merged again.