add toURI encode option

This commit is contained in:
Looly
2019-09-30 16:35:32 +08:00
parent 351abcefdc
commit 8c486b4e4f
4 changed files with 42 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ import java.util.List;
import java.util.Map;
import cn.hutool.core.io.IORuntimeException;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.URLUtil;
import cn.hutool.http.HttpConnection;
@@ -56,6 +57,7 @@ public class GlobalCookieManager {
Map<String, List<String>> cookieHeader;
try {
Console.log(URLUtil.toURI(conn.getUrl(), false));
cookieHeader = cookieManager.get(URLUtil.toURI(conn.getUrl()), new HashMap<String, List<String>>(0));
} catch (IOException e) {
throw new IORuntimeException(e);