Closed akowal closed 6 months ago
The current serialization of custom MIME types in Kotlin's RSocket implementation is not compatible with other implementations. The issue lies in the handling of the MIME type name's size during serialization and deserialization. Specifically, the Kotlin implementation directly writes the length of the MIME type name as it is: https://github.com/rsocket/rsocket-kotlin/blob/2239c5ca176694effbd803643d0179e79f76be3f/rsocket-core/src/commonMain/kotlin/io/rsocket/kotlin/frame/io/mimeType.kt#L50
Contrarily, other RSocket implementations such as Go and Java adjust the MIME type name length by decreasing it by one when writing and increasing it by one when reading:
This discrepancy makes Kotlin implementation incompatible with all other implementations.
The current serialization of custom MIME types in Kotlin's RSocket implementation is not compatible with other implementations. The issue lies in the handling of the MIME type name's size during serialization and deserialization. Specifically, the Kotlin implementation directly writes the length of the MIME type name as it is: https://github.com/rsocket/rsocket-kotlin/blob/2239c5ca176694effbd803643d0179e79f76be3f/rsocket-core/src/commonMain/kotlin/io/rsocket/kotlin/frame/io/mimeType.kt#L50
Contrarily, other RSocket implementations such as Go and Java adjust the MIME type name length by decreasing it by one when writing and increasing it by one when reading:
This discrepancy makes Kotlin implementation incompatible with all other implementations.