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

Check MIME types before decompressing to warn mismatching formats #142

Closed
marcospb19 opened this issue Nov 2, 2021 · 0 comments
Closed
Labels
enhancement New feature or request low priority
Milestone

Comments

@marcospb19
Copy link
Member

When decompressing, we usually rely on the file extensions being correct ("usually" because #134 will be added).

We should warn the users when the MIME type of some time does not match the decompression method we are using, giving an `[Y/n] dialog to ask if they want to proceed or skip.

Because of implementation limitations and complexity, we should check the MIME only at the surface of the file, even tho ouch supports files like archive.tar.gz.xz.bz2.zst.lz, our warnings should not decompress all the steps for checking MIME, only what can be read directly.

Implementation details: implementation should save the bytes in a small Vec/array instead of reading from the same file twice, because we also plan on support reading from STDIN, and you cannot read from it twice.

(Previously #5.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority
Projects
None yet
Development

No branches or pull requests

1 participant