emoxam
February 12, 2024, 7:51pm
1
Description
Can’t send ovpn file
“media types not accepted”
Server Setup Information
Version of Rocket.Chat Server: installed: 6.6.0 (1602) 361MB -
Operating System: ubuntu
Deployment Method: snap
Number of Running Instances:
DB Replicaset Oplog:
NodeJS Version:
MongoDB Version:
Proxy: nginx
Firewalls involved:
Desktop App or Browser Version: 3.9.12
Operating System: Windows
1 Like
DustpaN
February 19, 2024, 7:46am
2
Rocket.Chat Server: 6.6.0
Same issue
Problem in this commit
RocketChat:develop
← Sayan4444:uploadFile
opened 11:16AM - 30 Dec 23 UTC
Proposed changes (including videos or screenshots)
BEFORE THE FIX
https://gi… thub.com/RocketChat/Rocket.Chat/assets/112304873/68e9d8d0-3ef5-411a-93e5-d009ff97c331
AFTER THE FIX
https://github.com/RocketChat/Rocket.Chat/assets/112304873/73c161a2-3658-4b76-8276-e38dbfc6f177
REASON BEHIND CHANGES
If the type of file which we want to upload is not clear then we should not allow it to be uploaded in the server
Issue(s)
This should close issues :-
closes https://github.com/RocketChat/Rocket.Chat/issues/27924
Steps to test or reproduce
1. Login to rocket chat.
2. Set "Accepted Media Types" setting in "File Upload" section. For example image/*,application/pdf,text/plain,application/msword
3. Try sending a rare file type like .har
4. The file is not loaded into the chat, and there is no error message.
Was: invalidContentType: Boolean(file.type && !fileUploadIsValidContentType(file.type)),
Now: invalidContentType: !(file.type && fileUploadIsValidContentType(file.type)),
If we can’t detrminate a MIME type of a file (file.type) it will return a false and all not recognised types will be not work at all even if “Accepted Media Types” is empty.