distgit: disable mod_mime_magic content encoding for archives #3193

Merged
kevin merged 1 commit from victorkoycheff/ansible:issue-12812-fix-deflate-headers into main 2026-03-04 21:26:01 +00:00
Contributor

Fixes infra/tickets#12812.

It turns out mod_deflate was innocent. src.fedoraproject.org doesn't have gzip: true enabled in proxies-websites.yml, so the proxy never applied the DEFLATE filter.

The false headers are coming from the backend Apache (pkgs01). mod_mime_magic reads the first bytes of unknown files (like .crate), sees the gzip magic bytes, and automatically attaches Content-Type: application/x-tar and Content-Encoding: x-gzip.

This explicitly forces application/octet-stream and unsets the Content-Encoding header so clients don't double-decompress archives on the fly.

Fixes https://forge.fedoraproject.org/infra/tickets/issues/12812. It turns out `mod_deflate` was innocent. `src.fedoraproject.org` doesn't have `gzip: true` enabled in `proxies-websites.yml`, so the proxy never applied the DEFLATE filter. The false headers are coming from the backend Apache (`pkgs01`). `mod_mime_magic` reads the first bytes of unknown files (like `.crate`), sees the gzip magic bytes, and automatically attaches `Content-Type: application/x-tar` and `Content-Encoding: x-gzip`. This explicitly forces `application/octet-stream` and unsets the `Content-Encoding` header so clients don't double-decompress archives on the fly.
distgit: disable mod_mime_magic content encoding for archives
All checks were successful
Linter / yamllint (pull_request) Successful in 26s
Linter / ansible-lint (pull_request) Successful in 27s
9579a35ca5
mod_deflate wasn't the issue, as src didn't have gzip enabled. The
backend (pkgs01) uses mod_mime_magic, which sniffs .crate files
and adds false gzip headers. Forcing application/octet-stream
fixes the client double-decompression bug.

Fixes #12812.

Signed-off-by: Victor Koycheff <victorkoycheff@gmail.com>
Owner

Sounds possible. Lets try.

Sounds possible. Lets try.
kevin merged commit b935cd4d86 into main 2026-03-04 21:26:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
infra/ansible!3193
No description provided.