Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] File uploads for unknown file types but nothing is blocked #18263

Merged

Conversation

20051231
Copy link
Contributor

@20051231 20051231 commented Jul 15, 2020

Proposed changes

I When the block list is empty, all file types should be allowed. But if the browser does not recognize the mime of a file type, the file is still rejected.

Issue(s)

#16836

How to test or reproduce

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Hotfix (a major bugfix that has to be merged asap)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Changelog

Further comments

@sampaiodiego sampaiodiego changed the title [FIX] file upload without mime resolved [FIX] File uploads for unknown file types but nothing is blocked Jul 27, 2020
Copy link
Member

@sampaiodiego sampaiodiego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @20051231 🤗

@sampaiodiego sampaiodiego merged commit 7152ffa into RocketChat:develop Jul 27, 2020
@sampaiodiego sampaiodiego mentioned this pull request Jul 28, 2020
@stleitner
Copy link
Contributor

This only works if the block list is empty. If another media type is blocked, files with unrecognized mime type still fail.

@scratttt
Copy link

scratttt commented Dec 3, 2020

This only works if the block list is empty. If another media type is blocked, files with unrecognized mime type still fail.

Hello, Do you think this can be solved? If another media type is blocked, files with unrecognized mime type still fail.

Thanks!!

@20051231
Copy link
Contributor Author

20051231 commented Dec 4, 2020

This only works if the block list is empty. If another media type is blocked, files with unrecognized mime type still fail.

Hello, Do you think this can be solved? If another media type is blocked, files with unrecognized mime type still fail.

Thanks!!

If a blocked mime is not recognized by the browser, the file still need to be blocked so I did not change the logic in this case.

I think we might lookup the mime from the file extension in case of unrecognized mime. Or accept both mime and extension in the list?

@scratttt
Copy link

scratttt commented Dec 4, 2020

It is an option, if the browser does not recognize the mime, search if the file extension is in the whitelist.

@sprietNathanael
Copy link

It seems files without mime-types still can not be uploaded. Is there a way to make it work?

@jcarlosroldan
Copy link

jcarlosroldan commented Jan 20, 2022

We are also having this problem. The issue is not solved, shouldn't it be open instead of merged?

@kmare
Copy link

kmare commented Jan 20, 2022

I believe it should be open as I have the same issue still.

@sampaiodiego
Copy link
Member

just to make sure, do you guys have both blacklist and whitelist settings blank and can still not upload files? if so, please open a new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants