hawkbit-examples icon indicating copy to clipboard operation
hawkbit-examples copied to clipboard

DeviceSimulatorUpdater.readAndCheckDownloadUrl() error validated response using Gzip

Open Sdcxv opened this issue 7 years ago • 0 comments

I used caddy as the reverse proxy for the hawkbit server and enabled gzip compression while forwarding. However, this part of the client emulator (for http response entity content length check) filters the gzipped response, so it has not been able to trigger OTA file transfers.

                if (response.getEntity().getContentLength() != size) {
                    final String message = wrongContentLength(url, size, response);
                    return new UpdateStatus(ResponseStatus.ERROR, message);
                }

When gzip enable, response.getEntity().getContentLength() will be -1, according to org.apache.http.client.entity.GzipCompressingEntity.getContentLength()

Sdcxv avatar Jan 22 '19 07:01 Sdcxv