Duplicated mimetype info when sending an image to a room
See original GitHub issueWhen I send an image to an e2e room using Element Web, the clear event contains undocumented fields:
{
"type": "m.room.message",
"content": {
"body": "image.png",
"info": {
"size": 16144,
"mimetype": "image/png",
"thumbnail_info": {
"w": 166,
"h": 72,
"mimetype": "image/png",
"size": 4770
},
"w": 166,
"h": 72,
"thumbnail_file": {
"v": "v2",
"key": {
"alg": "A256CTR",
"ext": true,
"k": "rpj1sOJ6wO2oy3R0TkmzMtlTfq8gw34DDjBEomEcFg4",
"key_ops": [
"encrypt",
"decrypt"
],
"kty": "oct"
},
"iv": "mTh8NqPZ4XgAAAAAAAAAAA",
"hashes": {
"sha256": "VehmjJbux6m63u/zWs2zZCElqqGgQ5pFuUNzmm1uovg"
},
"url": "mxc://matrix.org/pKlpKPCIpzUBNElxmaAvuwbh",
"mimetype": "image/png" << This is not documented and redundant info
}
},
"msgtype": "m.image",
"file": {
"v": "v2",
"key": {
"alg": "A256CTR",
"ext": true,
"k": "7ApOyV_yijdMcXWMBvxApSwc_Nkl39GBxhSY3GdZRNI",
"key_ops": [
"encrypt",
"decrypt"
],
"kty": "oct"
},
"iv": "eH/zzQF1HEEAAAAAAAAAAA",
"hashes": {
"sha256": "EPedp3jPqlPPS4OCInieN9u5X4KHpbGVzb/1LAmIH/g"
},
"url": "mxc://matrix.org/TXyRLVIClHHgxJHFwcBfNMLd",
"mimetype": "image/png" << This is not documented and redundant info
}
}
}
According to https://matrix.org/docs/spec/client_server/r0.6.1#extensions-to-m-message-msgtypes, EncryptedFile.mimetype is not documented (but are present in the examples!), and the information it contains is already present at other place in this content.
For some reason, there is the same problem on Element Android, so this issue is probably more a question: why are we adding those fields?
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
duplicate MIME type "text/html"? - nginx - Stack Overflow
For the option gzip_types , the mime-type text/html is always included by default, so you don't need to specify it explicitly.
Read more >Duplicate MIME type warning · Issue #104 · google/ngx_brotli
Hi, When restarting or reloading NGINX i'm getting the followin warning: nginx: [warn] duplicate MIME type "text/html" in ...
Read more >MIME types (IANA media types) - HTTP - MDN Web Docs
CSS files used to style a Web page must be sent with text/css . ... The Image file type and format guide provides...
Read more >Duplicate mime types - MSDN - Microsoft
I have stupidly added a duplicate mime type in IIS 7 through the command line by using a command similar to this. appcmd...
Read more >Amazon Rekognition – frequently asked questions - AWS
Rekognition Image is an image recognition service that detects objects, scenes, activities, landmarks, faces, dominant colors, and image quality. Rekognition ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I have a sneaking suspicion that the example was just ripped out of Element Web’s
/devtoolsat some point without checking the contents too closely…If the field is truly redundant and not necessary, I don’t think there’s any reason to add it to the spec - and the example should be corrected. Element Web - if they want - will need to remove the fields and take care that nothing crucial that relies on it breaks.
If the field is actually useful, then someone should write an MSC for it. Additionally, the field existed before unstable prefixes were introduced, so Element Web shouldn’t need to switch to unstable prefixes in this case.
Now that the spec has removed these fields (MSC2582), I don’t believe there are any more blockers to stop sending this information.