Skip to content

add test cases for ZIP files where the local file header and central directory have different data in the "compression method" field.#29

Merged
folkertdev merged 1 commit intomainfrom
mismatched_compression_local_central_directory
Apr 7, 2026
Merged

add test cases for ZIP files where the local file header and central directory have different data in the "compression method" field.#29
folkertdev merged 1 commit intomainfrom
mismatched_compression_local_central_directory

Conversation

@armijnhemel
Copy link
Copy Markdown
Collaborator

The central directory and the local file header can have different information in various fields. These should be detected and reported by a linter, just as some other programs do (see the readme file for more information).

As an extension (or in "do whatever it takes" mode) it might make sense to try to be smart to try and detect what compression is actually used (but not when data is merely stored, as that is probably intentional) and use that when declared compression fails.

@armijnhemel
Copy link
Copy Markdown
Collaborator Author

of course, there are many other fields in the local file header/central directory that should be in sync and possibly are not. I could add more test cases, but perhaps a single one is enough.

@folkertdev folkertdev force-pushed the mismatched_compression_local_central_directory branch 3 times, most recently from 8e60578 to 914df9a Compare April 7, 2026 20:00
directory have different data in the "compression method" field.
@folkertdev folkertdev force-pushed the mismatched_compression_local_central_directory branch from 914df9a to aa223c9 Compare April 7, 2026 20:03
@folkertdev folkertdev merged commit 19fa8a1 into main Apr 7, 2026
2 checks passed
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.

2 participants