Closed digows closed 3 months ago
I found a fix for this method:
`
void addExplicitMimeType(String? mimeType, Uint8List? content) {
if (WellKnownMimeType.isWellKnownType(mimeType)) {
addWellKnownMimeType(
WellKnownMimeType.getMimeTypeId(mimeType)!, content!);
} else {
final mimeTypeArray = utf8.encode(mimeType!);
buffer.writeI8(mimeTypeArray.length-1);
buffer.writeBytes(mimeTypeArray);
buffer.writeI24(content!.length);
buffer.writeUint8List(content);
}
}
`
For some reason, the mime type length should be -1.
Hi,
I have created a custom Mimetype. Using Javascript rsocket client is working as expected.
But using the dart package, the metadata is being malformed.
Looks like this method is not working well for not well known mime types.
_file: compositemetadata.dart
void addExplicitMimeType(String? mimeType, Uint8List? content) {
if (WellKnownMimeType.isWellKnownType(mimeType)) { addWellKnownMimeType( WellKnownMimeType.getMimeTypeId(mimeType)!, content!); } else { var mimeTypeArray = utf8.encode(mimeType!); buffer.writeI8(mimeTypeArray.length); buffer.writeBytes(mimeTypeArray); buffer.writeI24(content!.length); buffer.writeUint8List(content); } }
if I send a well known type, it works.