1
0
mirror of synced 2025-12-26 20:48:00 +08:00

🎨 添加 Apache HttpComponents Client 5.x 为可选的 http client

This commit is contained in:
altusea
2025-06-09 14:29:35 +08:00
committed by GitHub
parent bf35797b91
commit ccbfa98864
136 changed files with 2689 additions and 492 deletions

View File

@@ -8,12 +8,10 @@ import static org.testng.Assert.*;
public class HttpResponseProxyTest {
public final ApacheHttpResponseProxy httpResponseProxy = new ApacheHttpResponseProxy(null);
@Test
public void testExtractFileNameFromContentString() throws WxErrorException {
String content = "attachment; filename*=utf-8''%E6%B5%8B%E8%AF%95.xlsx; filename=\"æµ<EFBFBD>è¯<EFBFBD>.xlsx\"";
String filename = httpResponseProxy.extractFileNameFromContentString(content);
String filename = HttpResponseProxy.extractFileNameFromContentString(content);
assertNotNull(filename);
assertEquals(filename, "测试.xlsx");
}
@@ -22,7 +20,7 @@ public class HttpResponseProxyTest {
public void testExtractFileNameFromContentString_another() throws WxErrorException {
String content = "attachment; filename*=utf-8''%E8%90%A5%E4%B8%9A%E6%89%A7%E7%85%A7.jpg; filename=\"è<EFBFBD>¥ä¸<EFBFBD>æ<EFBFBD>§ç<EFBFBD>§.jpg\"";
// String content = "attachment; filename=\"è<>¥ä¸<C3A4>æ<EFBFBD>§ç<C2A7>§.jpg\"";
String filename = httpResponseProxy.extractFileNameFromContentString(content);
String filename = HttpResponseProxy.extractFileNameFromContentString(content);
assertNotNull(filename);
assertEquals(filename, "营业执照.jpg");
}