Wednesday 28 February 2018

google chrome - Chromium: prevent unpacking tar.gz


The latest Chrome and Chromium seems to unpack .tar.gz files automatically for me on OS X and Linux. When using wget with the same URL, it shows:


$ wget http://mydomain/dir/file.tar.gz
...
HTTP request sent, awaiting response... 200 OK
Length: ... [application/octet-stream]
...

Verifying the file type:


$ file file.tar.gz
file.tar.gz: gzip compressed data, from FAT filesystem (MS-DOS, OS/2, NT)

When doing the same for the file downloaded with Chrome or Chromium:


$ file file.tar.gz
file.tar.gz: POSIX tar archive

Note, that Chrome/Chromium obviously kept the file name, but expanded it (the file size is ~4 times bigger than from the wget-downloaded file).


As website administrator how can I prevent Chrome/Chromium from unpacking the file?


Update:


According to curl -I http://mydomain/dir/file.tar.gz our Apache/Tomcat combo responds with


Content-Encoding: x-gzip

Tried .tar.gz files from other websites are not unpacked by chrome and don't report the Content-Encoding: x-gzip header, so there seems to be a relation.



Answer



According to our hosting provider the header Content-Encoding: x-gzip was caused by the Apache in front of our Tomcat. Removing following line:


LoadModule deflate_module               modules/mod_deflate.so

from its configuration solved the problem.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...