From 28b55a50176a89f9e39c46effb1d402c17afe5a2 Mon Sep 17 00:00:00 2001 From: Zed Date: Wed, 19 Aug 2026 02:39:25 +0700 Subject: [PATCH] Fix CF block --- src/apiutils.nim | 3 +-- src/http_pool.nim | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/apiutils.nim b/src/apiutils.nim index 91efe8e..e6a63f0 100644 --- a/src/apiutils.nim +++ b/src/apiutils.nim @@ -69,14 +69,13 @@ proc genHeaders*(session: Session, url: Uri, skipTid: bool): Future[HttpHeaders] "accept": "*/*", "accept-encoding": "gzip", "accept-language": "en-US,en;q=0.9", - "connection": "keep-alive", "content-type": "application/json", "origin": "https://x.com", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36", "x-twitter-active-user": "yes", "x-twitter-client-language": "en", "priority": "u=1, i" - }) + }, titleCase=true) case session.kind of SessionKind.oauth: diff --git a/src/http_pool.nim b/src/http_pool.nim index 664e9a6..2553dd9 100644 --- a/src/http_pool.nim +++ b/src/http_pool.nim @@ -27,7 +27,7 @@ proc release*(pool: HttpPool; client: AsyncHttpClient; badClient=false) = proc acquire*(pool: HttpPool; heads: HttpHeaders): AsyncHttpClient = if pool.conns.len == 0: - result = newAsyncHttpClient(headers=heads, proxy=proxy) + result = newAsyncHttpClient(userAgent="", headers=heads, proxy=proxy) else: result = pool.conns.pop() result.headers = heads