fix(fetchers): Adjusting all cookies returned from each fetcher

The cookies returned now can be passed again to each fetcher's engine without further validation by us.
This commit is contained in:
Karim shoair
2025-05-10 19:16:34 +03:00
parent bd47c070aa
commit c84143129e
4 changed files with 11 additions and 21 deletions
+4 -9
View File
@@ -164,7 +164,7 @@ class CamoufoxEngine:
else StatusText.get(301),
encoding=current_response.headers.get("content-type", "")
or "utf-8",
cookies={},
cookies=tuple(),
headers=current_response.all_headers()
if current_response
else {},
@@ -207,7 +207,7 @@ class CamoufoxEngine:
else StatusText.get(301),
encoding=current_response.headers.get("content-type", "")
or "utf-8",
cookies={},
cookies=tuple(),
headers=await current_response.all_headers()
if current_response
else {},
@@ -450,9 +450,7 @@ class CamoufoxEngine:
status=final_response.status,
reason=status_text,
encoding=encoding,
cookies={
cookie["name"]: cookie["value"] for cookie in page.context.cookies()
},
cookies=tuple(dict(cookie) for cookie in page.context.cookies()),
headers=first_response.all_headers(),
request_headers=first_response.request.all_headers(),
history=history,
@@ -554,10 +552,7 @@ class CamoufoxEngine:
status=final_response.status,
reason=status_text,
encoding=encoding,
cookies={
cookie["name"]: cookie["value"]
for cookie in await page.context.cookies()
},
cookies=tuple(dict(cookie) for cookie in await page.context.cookies()),
headers=await first_response.all_headers(),
request_headers=await first_response.request.all_headers(),
history=history,