提交 d623d692 编写于 作者: L Looly

add closeCookie

上级 4f634c38
......@@ -3,9 +3,10 @@
-------------------------------------------------------------------------------------------------------------
# 5.6.5 (2021-04-25)
# 5.6.5 (2021-05-08)
### 🐣新特性
* 【http 】 HttpUtil增加closeCookie方法
### 🐞Bug修复
-------------------------------------------------------------------------------------------------------------
......
......@@ -13,11 +13,13 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.http.cookie.GlobalCookieManager;
import cn.hutool.http.server.SimpleServer;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.CookieManager;
import java.net.HttpURLConnection;
import java.nio.charset.Charset;
import java.util.ArrayList;
......@@ -838,4 +840,14 @@ public class HttpUtil {
final String data = username.concat(":").concat(password);
return "Basic " + Base64.encode(data, charset);
}
/**
* 关闭Cookie
*
* @see GlobalCookieManager#setCookieManager(CookieManager)
* @since 5.6.5
*/
public static void closeCookie() {
GlobalCookieManager.setCookieManager(null);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册