Bug 497517 - Double gzipped attachments
Summary: Double gzipped attachments
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Attachments/Requests
Version: 3.2
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-24 12:23 UTC by Miroslav Suchý
Modified: 2013-06-24 04:09 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-27 07:08:32 UTC
Embargoed:


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

Description Miroslav Suchý 2009-04-24 12:23:51 UTC
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 16:59:06 UTC
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.

Dave

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

testing recent change

Comment 3 David Lawrence 2009-04-24 17:24:10 UTC
Sadly that did not fix the issue. Will need to investigate further.

Comment 4 David Lawrence 2009-04-24 19:55:12 UTC
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.

Dave

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

Dave

Comment 6 Miroslav Suchý 2009-04-27 07:06:54 UTC
Created attachment 341391 [details]
Test gzipped file

Comment 7 Miroslav Suchý 2009-04-27 07:08:32 UTC
Yes, works for me.
Thx.


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