ソースを参照

fix inflate bug

Looly 6 年 前
コミット
303f97ae5e

+ 0 - 4
hutool-http/src/main/java/cn/hutool/http/HttpInputStream.java

@@ -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 {

+ 8 - 0
hutool-http/src/test/java/cn/hutool/http/test/HttpRequestTest.java

@@ -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);
+	}
 }

+ 1 - 8
hutool-http/src/test/java/cn/hutool/http/test/HttpUtilTest.java

@@ -62,14 +62,6 @@ public class HttpUtilTest {
 	
 	@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() {
 		String result = HttpUtil.get("https://kyfw.12306.cn/otn/");
 		Console.log(result);
@@ -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