cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Kotikov (JIRA)" <>
Subject [jira] [Commented] (CB-9427) GZip decompression doesn't work
Date Tue, 01 Sep 2015 09:54:46 GMT


Vladimir Kotikov commented on CB-9427:

[~abratashov], it seems that server returns incorrect headers.
In your case Content-Type should be {{application/json}}. Otherwise WebView treats response
body as binary data and don't decompress it. 

Consider simple server server example below (just place it in the root of cordova application
and run with node):
require('http').createServer(function(request, response) {
  response.writeHead(200, { 'content-encoding': 'gzip', 'content-type': 'application/gzip'

If you try to send XHR from app, you will get a response with compressed response. Once you
change  {{'content-type': 'application/gzip'}} -> {{ 'content-type': 'application/json'}}
and relaunch server, the response became correct (decompressed).

> GZip decompression doesn't work
> -------------------------------
>                 Key: CB-9427
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.5.0, 4.3.0, 5.1.1
>            Reporter: Oleksandr Bratashov
>            Assignee: Vladimir Kotikov
> I try enable GZip compression for improve connection performance between client and server,
but it seems that WebView doesn't decompress GZip-response.
> Response Header(from server) contains:
> Content-Encoding:gzip
> Content-Type:application/gzip
> Body contains compressed JSON
> On the Desktop browsers all fine,
> but if it is android device in Chrome DevTools I see compressed body.
> Mobile app doesn't decompress response body.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message