add: support for gzip encoded http response

This commit is contained in:
Tobi Schäfer 2020-04-10 20:25:05 +02:00
parent a5bc33db70
commit df3af8fab1

View file

@ -62,7 +62,11 @@ helma.Http = function() {
var input; var input;
try { try {
if (method !== 'DELETE') { if (method !== 'DELETE') {
input = new java.io.BufferedInputStream(connection.getInputStream()); var stream = connection.getInputStream();
if (connection.getContentEncoding() === 'gzip') {
stream = new java.util.zip.GZIPInputStream(stream);
}
input = new java.io.BufferedInputStream(stream);
} }
} catch (error) { } catch (error) {
input = new java.io.BufferedInputStream(connection.getErrorStream()); input = new java.io.BufferedInputStream(connection.getErrorStream());