Closed Bug 91862 Opened 23 years ago Closed 23 years ago

Save Link As still expands gzipped files [Content-Encoding: x-gzip]

Categories

(Core :: Networking: HTTP, defect, P2)

x86
All
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.4

People

(Reporter: greenrd, Assigned: darin.moz)

References

()

Details

(Whiteboard: r=bbaetz, sr=mscott)

Attachments

(1 file)

Build id: 20010472008

Bug 35956 is not completely fixed. (bugzilla didn't give me an option to reopen it.)

This is the difference:

Click on the "Cached: ps.gz" link on the right side of the page.

If you left-click on the link, it works fine.
If you right-click on the link and choose Save Link As from the context menu, it
expands the gzipped file, but incorrectly leaves the file extension as .ps.gz
(as in bug 35956).

Remember to always clear caches before testing this bug, in order to not bias
the results thru caching!
confirming. I remember dicsussing this case with darin, but I can't remember
what we decided on. This bug probably belongs to morse, IIRC.

Appropriate headers:

Content-Type: application/postscript
Content-Encoding: x-gzip
Status: UNCONFIRMED → NEW
Component: Browser-General → Networking: HTTP
Ever confirmed: true
QA Contact: doronr → benc
imo This isn't a regression. the bug here is that we don't offer to fix the 
filename.

<q src="http://lists.w3.org/Archives/Public/www-talk/2000MayJun/0003.html">

RFC2616 says (section 7.2.1):

   Content-Type specifies the media type of the underlying data.
   Content-Encoding may be used to indicate any additional content
   codings applied to the data, usually for the purpose of data
   compression, that are a property of the requested resource. There is
   no default encoding.

My understanding of that is it is encoding of the transfer, not of the
data.
</q>
<q src="http://lists.w3.org/Archives/Public/www-talk/2000MayJun/0004.html" 
type="text/summary">
concurs, decode the Encoding, fix the filename, write to disk.
</q>
Summary: Save Link As still expands gzipped files (bug 35956 regression) → Save Link As still expands gzipped files [Content-Encoding: x-gzip]
timeless, yeah, but there are other issues (including an apache bug where .gz 
content is listed as content-type: application/gzip and content-enconding: 
gzip). Servers use content-encoding as transfer-encoding, probably for both 1.0 
compatability, and the fact that neither netscape or ie support transfer 
encodings, AFAIK.
Clearly, whatever solution is chosen, the left-click and right-click methods
described in my original report should behave identically.
No, actually :) That was part of the problem. For example, sourceforge's index
page is sent as content-type: text/html, content-encoding: gzip.

With content encoding, we need to strip it off before displaying, but not before
saving it. Thats what the spec says to do, and it makes sense (otherwise we do
what you observed). Imagine if you had a postscript plugin, similar to the ps
one. You'd still want the plugin to be able to read it, no matter how it was
encoded, but you want it saved 'as-is'
We are in agreement. In my test case, I don't have a postscript plugin
installed, so both actions result in a save.
save-link-as should be calling nsIHttpChannel::SetApplyConversions(PR_FALSE)
before calling AsyncOpen, since it knows that it won't be feeding the data to a
docshell or helper application.

-> moz 0.9.4
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla0.9.4
it turns out that the problem here is that we are not forwarding the
mApplyConversion property when redirecting, and the 'Cached: PS.gz' link results
in a redirect!  this is a really simple fix.
Keywords: patch
r=bbaetz
Whiteboard: r=bbaetz, sr=?
sr=mscott
Whiteboard: r=bbaetz, sr=? → r=bbaetz, sr=mscott
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
*** Bug 95242 has been marked as a duplicate of this bug. ***
*** Bug 97165 has been marked as a duplicate of this bug. ***
*** Bug 95242 has been marked as a duplicate of this bug. ***
I have verified on PC/Linux that both testcases in this bug and in bug 95242
fail in 0.9.3, but pass in 0.9.4. 

Verification still needed on Windows (both duplicates have been reported on
Windows 98).
OS: Linux → All
Tried test case from bug 95242 on Mozilla 0.9.4, on Windows 98.  It now works
correctly.  The gz file is still gzipped after download.

     Brent
QA Contact: benc → tever
verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: