perf: 禁用爬虫的 Cookie 管理以绕过 Cookie 限制

有助于绕过部分通过 Cookie 来识别爬虫的反爬机制。
This commit is contained in:
xiongxiaoyang
2025-10-01 13:36:18 +08:00
parent 8448e86ac5
commit 803607350e

View File

@@ -63,6 +63,8 @@ public class RestTemplates {
connectionManager.setDefaultMaxPerRoute(300);
HttpClientBuilder clientBuilder = HttpClients.custom();
// 禁用 Cookie 管理
clientBuilder.disableCookieManagement();
if (Objects.nonNull(httpProxyProperties) && Boolean.TRUE.equals(httpProxyProperties.getEnabled())) {
HttpHost proxy = new HttpHost(httpProxyProperties.getIp(), httpProxyProperties.getPort());
clientBuilder.setProxy(proxy);