Merge pull request #593 from LW66666/v5-dev

V5 dev
This commit is contained in:
Golden Looly 2019-10-20 22:18:40 +08:00 committed by GitHub
commit d71f7517a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,8 +4,9 @@ import java.io.ByteArrayInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.DeflaterInputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;
import cn.hutool.core.util.StrUtil;
@ -103,9 +104,9 @@ public class HttpInputStream extends InputStream {
// 在类似于Head等方法中无body返回此时GZIPInputStream构造会出现错误在此忽略此错误读取普通数据
// ignore
}
} else if (response.isDeflate() && false == (this.in instanceof DeflaterInputStream)) {
} else if (response.isDeflate() && false == (this.in instanceof InflaterInputStream)) {
// Accept-Encoding: defalte
this.in = new DeflaterInputStream(this.in);
this.in = new InflaterInputStream(this.in, new Inflater(true));
}
}
}