go-coap icon indicating copy to clipboard operation
go-coap copied to clipboard

Bad option mux.Message.Path() returns invalid utf-8 strings instead of error

Open palsivertsen opened this issue 1 year ago • 1 comments

The mux.Message.Path() method returns an invalid utf-8 string when the path option contain invalid bytes instead of an error.

This bug happened for incoming requests where the path option was set to []byte{0xbf, 'g'} (0xbf is not valid utf-8 encoding).

This example in the go playground demonstrates the issue.

palsivertsen avatar Dec 09 '24 16:12 palsivertsen

Thank you for the reporting issue. If you have a fix with a test we can merge it.

jkralik avatar Dec 09 '24 20:12 jkralik