fix(fetchers): More accurate collection of the final response

This will make the `response.body` return the raw response for text/json responses as well
This commit is contained in:
Karim shoair
2025-10-12 04:12:18 +03:00
parent 6bfa266c90
commit 073c4910d4
3 changed files with 11 additions and 11 deletions
@@ -257,6 +257,7 @@ class DynamicSession(DynamicSessionMixin, SyncSession):
if (
finished_response.request.resource_type == "document"
and finished_response.request.is_navigation_request()
and finished_response.request.frame == page_info.page.main_frame
):
final_response = finished_response
@@ -503,6 +504,7 @@ class AsyncDynamicSession(DynamicSessionMixin, AsyncSession):
if (
finished_response.request.resource_type == "document"
and finished_response.request.is_navigation_request()
and finished_response.request.frame == page_info.page.main_frame
):
final_response = finished_response