From 4b5749bc607f3f94415ba19699e8a6ca39722456 Mon Sep 17 00:00:00 2001 From: Redkale <22250530@qq.com> Date: Mon, 16 Jan 2017 11:50:19 +0800 Subject: [PATCH] --- src/org/redkale/util/Utility.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/org/redkale/util/Utility.java b/src/org/redkale/util/Utility.java index 140c6e92c..7639ab905 100644 --- a/src/org/redkale/util/Utility.java +++ b/src/org/redkale/util/Utility.java @@ -11,6 +11,7 @@ import java.nio.ByteBuffer; import java.nio.charset.*; import java.time.*; import java.util.*; +import java.util.zip.GZIPInputStream; import javax.net.ssl.*; /** @@ -764,6 +765,7 @@ public final class Utility { return remoteHttpContent(ctx, method, newurl, timeout, headers, body); } InputStream in = (rs < 400 || rs == 404) && rs != 405 ? conn.getInputStream() : conn.getErrorStream(); + if ("gzip".equalsIgnoreCase(conn.getContentEncoding())) in = new GZIPInputStream(in); ByteArrayOutputStream out = new ByteArrayOutputStream(1024); byte[] bytes = new byte[1024]; int pos;