Bug 497517 - Double gzipped attachments
Double gzipped attachments
Product: Bugzilla
Classification: Community
Component: Attachments/Requests (Show other bugs)
All Linux
low Severity medium (vote)
: ---
: ---
Assigned To: David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2009-04-24 08:23 EDT by Miroslav Suchý
Modified: 2013-06-24 00:09 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-04-27 03:08:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
test gzipped attachment (631 bytes, application/x-gzip)
2009-04-24 13:22 EDT, David Lawrence
no flags Details
Test gzipped file (79.28 KB, application/x-gzip)
2009-04-27 03:06 EDT, Miroslav Suchý
no flags Details

  None (edit)
Description Miroslav Suchý 2009-04-24 08:23:51 EDT
Description of problem:
When I attach tar.gz and I download it again it is demaged.

Version-Release number of selected component (if applicable):
current stable (3.2?)

How reproducible:
done twice

Steps to Reproduce:
1. create foo.tar.gz
2. upload it as attachment to BZ, and manualy set mime type to application/x-gzip
3. download it
4. file foo.tar.gz
foo.tar.gz: gzip compressed data, from Unix
4. gunzip foo.tar.gz
5. file foo.tar
foo.tar: gzip compressed data, from Unix
Actual results:
#file foo.tar
foo.tar: gzip compressed data, from Unix

Expected results:
# file foo.tar
proxy-patches.tar: POSIX tar archive

Additional info:
If I rename the downloaded file to foo.tar.gz.gz and then double ungzipped it then I got the tar file I wanted.
Comment 1 David Lawrence 2009-04-24 12:59:06 EDT
I have asked the sys admins for Bugzilla to add the following to the apache configs which should hopefully fix this issue:

SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar|iso)$ no-gzip dont-vary

We will close this once I verify that this has fixed the problem.

Comment 2 David Lawrence 2009-04-24 13:22:40 EDT
Created attachment 341223 [details]
test gzipped attachment

testing recent change
Comment 3 David Lawrence 2009-04-24 13:24:10 EDT
Sadly that did not fix the issue. Will need to investigate further.
Comment 4 David Lawrence 2009-04-24 15:55:12 EDT
Sadly attachment.cgi in Bugzilla creates a dynamic file download so the
current SetEnvIfNoCase directives only work for request URI's and cannot filter on Content-Type.

I have also tried other options such as mod_filter and AddOutputFilterByType without success.

We are in the process of adding the following directive to the live bugzilla configs. This is a workaround for the moment which does fix the issue for my test case.

# Don't compress if attachment
SetEnvIfNoCase Request_URI /attachment\.cgi no-gzip dont-vary

This is a hack in that any content delivered from the attachment.cgi will never be compressed even the text/html but people do no spend alot of time on that page and for the most part images/css/javascript will be cached on the client until it expires.

Once this is in place I will verify it is working and ask you to try your case again as well.

Comment 5 David Lawrence 2009-04-24 16:39:43 EDT
Ok works for me now. Can you verify for yourself and then close this bug if the issue is resolved?

Comment 6 Miroslav Suchý 2009-04-27 03:06:54 EDT
Created attachment 341391 [details]
Test gzipped file
Comment 7 Miroslav Suchý 2009-04-27 03:08:32 EDT
Yes, works for me.

Note You need to log in before you can comment on or make changes to this bug.