Can I force gzip decode?
See original GitHub issueMy request returns a gzip encoded response but the responding server does not set the content-encoding
to gzip
. Looking at the code, the automatic gzip decoding only activates if content-encoding
is gzip
or am I missing something. Is there a way to force enable the gzip decoding? Or am i stuck with having to decode the response with my own code?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Force gzip to decompress despite CRC error - Stack Overflow
The gzip command will decompress all valid deflate data and write it out before checking the crc. So if, for example, I take...
Read more >3 Invoking gzip - GNU.org
Decompress. Force compression or decompression even if the file has multiple links or the corresponding file already exists, or if the compressed data...
Read more >Gzip decompress on file with other extension?
Normally unzipping restores the name and date of the original file (when it was compressed); this doesn't happen with -c . If you...
Read more >How To Optimize Your Site With GZIP Compression
In your browser: In Chrome, open the Developer Tools > Network Tab (Firefox/IE will be similar). Refresh your page, and click the network...
Read more >How to Enable GZIP Compression to Speed Up WordPress Sites
Learn how to enable GZIP compression to speed up your WordPress site on various web servers like Apache, Nginx, and IIS.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@teolag That’s right - when there is no `content-encoding header, node-fetch does not decode the response:
https://github.com/node-fetch/node-fetch/blob/0936a9af0a049eb05897779f3f0df6b903a95d60/src/index.js#L225
Right now there is no other way than handling the decompression yourself. I would highly recommend asking the server owner (if it’s possible of course) to add this header. We might add an option to force the decoding in the future.