go-coap
go-coap copied to clipboard
Bad option mux.Message.Path() returns invalid utf-8 strings instead of error
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.
Thank you for the reporting issue. If you have a fix with a test we can merge it.