nsIWebBrowserPersist should decompress data if server responses with "Content-Encoding: gzip" header

RESOLVED INVALID

Status

defect
RESOLVED INVALID
11 years ago
2 months ago

People

(Reporter: gomita, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

594 bytes, application/x-javascript
Details
Reporter

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Build Identifier: 

nsIWebBrowserPersist is a convinient class to save something from a web server.
However, if the server transfers data with gzip-comperssed, i.e. responses with "Content-Encoding: gzip" header, nsIWebBrowserPersist saves it to a file without decompressing data.


Reproducible: Always

Steps to Reproduce:
1.Clear cache.
2.Execute the subsequent testcase, which is a simple JavaScript code to save Amazon.com's favicon.ico.
3.Check the saved file.

Actual Results:  
The file is compressed. We should unzip it to extract the real favicon.


Expected Results:  
The file is decompressed and it is the real favicon.


A work-around is that using nsIWebBrowserPersist::saveChannel and remove "Accept-Encoding: gzip,deflate" header when requesting to the server.
Reporter

Comment 1

11 years ago
Posted file testcase
Reporter

Comment 2

11 years ago
Sorry, I found that PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION flag solves the problem.
This bug is INVALID.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → INVALID

Updated

2 months ago
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.