-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Prevent preview binary or large file #939
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start but there's some improvements we can do:
- Remove unwraps - Reuse a single read buffer to avoid 1kb reallocations between previews
Sorry, I messed up this branch with execute |
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Now, I think it get back to what it should be. |
@sudormrfbin PS: Any reason c91ee94 is not good, you can delete my commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty close to what I was coming up with, and apart from a few naming nitpicks looks good to me ! Great job :)
I don't like naming I did on last commit, too. They should be renamed. |
Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ! Good work @diegodox 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @diegodox !
This PR adds binary file and large file detection for file picker. (#847)
Use content_inspector to detect binary file (I'm new to this project, let me know any already exist way on this project to detect binary file).