When downloading tar.gz artifacts with Firefox, which sets Accept-Encoding: gzip, deflate, br, zstd, the downloaded file is broken and has a different size than when downloaded with other browsers like Edge or Chrome.
Evaluation
GzipHandler incorrectly kicks in, double-gzipping the file. Normally GzipHandler ignores the application/gzip MIME type, but we were incorrectly sending the MIME type application/x-gtar.
Solution
Send the correct MIME type by bringing mime.properties closer to upstream Jetty. Note that the explicit tar.gz mapping is only needed for Jetty 10 and must be removed pending the adoption of jetty/jetty.project#8919.
Testing done
Reproduced the issue as described in the ticket on Firefox. Also confirmed the issue was not visible on Chrome. After this PR, both Firefox and Chrome work.
Added new unit test that fails before this PR and passes after.
Submitter checklist
[ ] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
[ ] Ensure that the pull request title represents the desired changelog entry
[ ] Please describe what you did
[ ] Link to relevant issues in GitHub or Jira
[ ] Link to relevant pull requests, esp. upstream and downstream changes
[ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue
Problem
When downloading
tar.gz
artifacts with Firefox, which setsAccept-Encoding: gzip, deflate, br, zstd
, the downloaded file is broken and has a different size than when downloaded with other browsers like Edge or Chrome.Evaluation
GzipHandler
incorrectly kicks in, double-gzipping the file. NormallyGzipHandler
ignores theapplication/gzip
MIME type, but we were incorrectly sending the MIME typeapplication/x-gtar
.Solution
Send the correct MIME type by bringing
mime.properties
closer to upstream Jetty. Note that the explicittar.gz
mapping is only needed for Jetty 10 and must be removed pending the adoption of jetty/jetty.project#8919.Testing done
Submitter checklist