Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.tgz files are double-gzipped #12397

Open
basil opened this issue Oct 16, 2024 · 0 comments
Open

.tgz files are double-gzipped #12397

basil opened this issue Oct 16, 2024 · 0 comments
Labels
Bug For general bugs on Jetty side

Comments

@basil
Copy link
Contributor

basil commented Oct 16, 2024

Jetty version(s)

12.0.14

Jetty Environment

EE 9
EE 10

Java version/vendor

openjdk version "17.0.12" 2024-07-16
OpenJDK Runtime Environment (build 17.0.12+7-Ubuntu-1ubuntu222.04)
OpenJDK 64-Bit Server VM (build 17.0.12+7-Ubuntu-1ubuntu222.04, mixed mode, sharing)

OS type/version

Ubuntu 22.04.5 LTS x86_64

Context

See JENKINS-73942.

Steps to reproduce

$ wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/12.0.14/jetty-home-12.0.14.tar.gz
$ tar -xzvf jetty-home-12.0.14.tar.gz
$ export JETTY_HOME=/path/to/jetty-home-12.0.14
$ git clone https://github.com/basil/jetty-tgz-repro.git
$ export JETTY_BASE=/path/to/jetty-tgz-repro

Observe the files are identical:

$ sha256sum $JETTY_BASE/webapps/static/resources/example.tar.gz $JETTY_BASE/webapps/static/resources/example.tgz
45749065add6664e1fc7c5a75665dd9dac85f70a1444612b895b222538601a13  webapps/static/resources/example.tar.gz
45749065add6664e1fc7c5a75665dd9dac85f70a1444612b895b222538601a13  webapps/static/resources/example.tgz

Start the server:

$ $JETTY_HOME/bin/jetty.sh start

Visit http://127.0.0.1:8080/static/ in Firefox and download both files.

Expected results

The files should be identical.

Actual results

The files are not identical, as the .tgz file is (erroneously!) double-gzipped. The .tar.gz file is correct.

$ sha256sum example.tar.gz example.tgz 
45749065add6664e1fc7c5a75665dd9dac85f70a1444612b895b222538601a13  example.tar.gz
1ca0c922947f4426b90526f3ec5427d2123b4b6fec92e66f8b14cec792271dae  example.tgz

Note

The problem only appears when the gzip module is enabled.

The problem disappeared after I unzipped $JETTY_HOME/lib/jetty-http-12.0.14.jar, updated org/eclipse/jetty/http/mime.properties to replace tgz=application/x-gtar with tgz=application/gzip, re-packed the JAR, and relaunched Jetty.

@basil basil added the Bug For general bugs on Jetty side label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
Development

No branches or pull requests

1 participant