This commit is contained in:
Looly 2022-10-22 22:50:31 +08:00
parent ab35ba10a2
commit 64e983db0f
2 changed files with 29 additions and 8 deletions

View File

@ -74,7 +74,6 @@ public class GlobalCookieManager {
throw new IORuntimeException(e);
}
// 不覆盖模式回填Cookie头这样用户定义的Cookie将优先
conn.header(cookieHeader, false);
}

View File

@ -0,0 +1,22 @@
package cn.hutool.http;
import cn.hutool.core.lang.Console;
import cn.hutool.http.cookie.GlobalCookieManager;
import org.junit.Ignore;
import org.junit.Test;
import java.net.HttpCookie;
import java.util.List;
public class Issue2658Test {
@SuppressWarnings("resource")
@Test
@Ignore
public void getWithCookieTest(){
HttpRequest.get("https://www.baidu.com/").execute();
final List<HttpCookie> cookies = GlobalCookieManager.getCookieManager().getCookieStore().getCookies();
Console.log("###" + cookies);
HttpRequest.get("https://www.baidu.com/").execute();
}
}