fix inflate bug

This commit is contained in:
Looly 2019-10-20 22:25:48 +08:00
parent 78472ee493
commit 303f97ae5e
3 changed files with 9 additions and 12 deletions

View File

@ -92,10 +92,6 @@ public class HttpInputStream extends InputStream {
return;
}
// TODO 分段响应内容解析
if(response.isChunked()) {
}
if (response.isGzip() && false == (response.in instanceof GZIPInputStream)) {
// Accept-Encoding: gzip
try {

View File

@ -98,4 +98,12 @@ public class HttpRequestTest {
.setSSLProtocol(SSLSocketFactoryBuilder.TLSv12);
Console.log(request.execute().body());
}
@Test
@Ignore
public void getDeflateTest() {
String res = HttpRequest.get("https://comment.bilibili.com/67573272.xml")
.execute().body();
Console.log(res);
}
}

View File

@ -60,14 +60,6 @@ public class HttpUtilTest {
Console.log(str);
}
@Test
@Ignore
public void getTest5() {
String res = HttpRequest.get("https://comment.bilibili.com/67573272.xml")
.execute().body();
Console.log(res);
}
@Test
@Ignore
public void get12306Test() {
@ -98,6 +90,7 @@ public class HttpUtilTest {
// 请求下一页检查Cookie是否复用
listContent = HttpUtil.get("https://www.oschina.net/action/ajax/get_more_news_list?newsType=&p=3");
Console.log(listContent);
}
@Test