Description
DecodeControl function does not check if interface casts are possible. Impossible cast will cause panics. In particular the default case on switch controlType is prone to this, as the (misbehaving) server may return non-string values.
Expected behavior
No panics in the library.
Alternative approaches:
- Catch PANIC on DecodeControl and turn them into error responses
- Check interface cast return values
In addition expecting unknown controlType data to contain string values feels odd. Maybe it would be better to leave interpretation of this unsafe data to the application?
This may relate to #538