From df3af8fab19f7ba10c644725999b0d032c0661ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Fri, 10 Apr 2020 20:25:05 +0200 Subject: [PATCH] add: support for gzip encoded http response --- modules/helma/Http.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/helma/Http.js b/modules/helma/Http.js index 3cc19ae0..a379d54c 100644 --- a/modules/helma/Http.js +++ b/modules/helma/Http.js @@ -62,7 +62,11 @@ helma.Http = function() { var input; try { 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) { input = new java.io.BufferedInputStream(connection.getErrorStream());