jenkinsci / winstone

Patched winstone used in Jenkins
https://jenkins.io
Other
88 stars 72 forks source link

[JENKINS-73381] Downloading `tar.gz` artifacts in Firefox is broken #397

Closed basil closed 3 months ago

basil commented 3 months ago

Problem

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

Submitter checklist