mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-06 21:58:03 +08:00
Merge branch 'v5-dev' of github.com:looly/hutool into v5-dev
This commit is contained in:
commit
78472ee493
@ -4,8 +4,9 @@ import java.io.ByteArrayInputStream;
|
|||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.zip.DeflaterInputStream;
|
|
||||||
import java.util.zip.GZIPInputStream;
|
import java.util.zip.GZIPInputStream;
|
||||||
|
import java.util.zip.Inflater;
|
||||||
|
import java.util.zip.InflaterInputStream;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
||||||
@ -103,9 +104,9 @@ public class HttpInputStream extends InputStream {
|
|||||||
// 在类似于Head等方法中无body返回,此时GZIPInputStream构造会出现错误,在此忽略此错误读取普通数据
|
// 在类似于Head等方法中无body返回,此时GZIPInputStream构造会出现错误,在此忽略此错误读取普通数据
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
} else if (response.isDeflate() && false == (this.in instanceof DeflaterInputStream)) {
|
} else if (response.isDeflate() && false == (this.in instanceof InflaterInputStream)) {
|
||||||
// Accept-Encoding: defalte
|
// Accept-Encoding: defalte
|
||||||
this.in = new DeflaterInputStream(this.in);
|
this.in = new InflaterInputStream(this.in, new Inflater(true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user