diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ddfaf389..312a97d2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ over unchanged punctuation. Added support for QML. +ZIP files are now always treated as binary files. + ## 0.35 (released 2nd September 2022) ### Diffing diff --git a/src/files.rs b/src/files.rs index f760c0e55..2f10e595b 100644 --- a/src/files.rs +++ b/src/files.rs @@ -115,6 +115,10 @@ pub fn guess_content(bytes: &[u8]) -> ProbableFileKind { match mime { // Treat pdf as binary. "application/pdf" => return ProbableFileKind::Binary, + // application/* is a mix of stuff, application/json is fine + // but application/zip is binary that often looks text-ish to + // our heuristics. + "application/zip" => return ProbableFileKind::Binary, // Treat all image content as binary. v if v.starts_with("image/") => return ProbableFileKind::Binary, // Treat all audio content as binary.