Skip to content

Commit

Permalink
👽 [#4795] Handle libmagic 5.46 behaviour
Browse files Browse the repository at this point in the history
Validated with Sonny who's also using Arch - since libmagic 5.46 the
detected content type for these 'exotic' zip formats no longer reports
application/zip, but instead it returns application/octet-stream, or
otherwise said: it doesn't know those magic bytes (anymore).

Given the earlier patches, all we can do is allow these files to go
through.

Our Docker images are based on Debian bookworm, which ships libmagic
5.44. Debian unstable currently still has 5.44.
  • Loading branch information
sergei-maertens committed Dec 31, 2024
1 parent f09aa68 commit 4574fe8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/openforms/formio/api/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ def __call__(self, value: UploadedFile) -> None:
# which is deprecated but still we need to support it. Instead, the common
# case for zip files is application/zip or application/zip-compressed
# mimetype.
# libmagic 5.46+ doesn't detect application/zip anymore.
case (
"application/zip-compressed" | "application/x-zip-compressed",
"application/zip",
"application/zip" | "application/octet-stream",
"zip",
):
return
Expand Down

0 comments on commit 4574fe8

Please sign in to comment.