Zed 3 hete
szülő
commit
28b55a5017
2 módosított fájl, 2 hozzáadás és 3 törlés
  1. 1 2
      src/apiutils.nim
  2. 1 1
      src/http_pool.nim

+ 1 - 2
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:

+ 1 - 1
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