Skip to content

Commit

Permalink
Update docs for PLAYWRIGHT_PROCESS_REQUEST_HEADERS setting
Browse files Browse the repository at this point in the history
  • Loading branch information
elacuesta committed Jul 16, 2024
1 parent d288003 commit 3ec1285
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,8 @@ async def custom_headers(
scrapy_request_data: dict,
) -> Dict[str, str]:
headers = await playwright_request.all_headers()
if browser_type == "firefox":
headers["User-Agent"] = "asdf"
else:
scrapy_headers = scrapy_request_data["headers"].to_unicode_dict()
headers["Content-Type"] = scrapy_headers.get("Content-Type")
scrapy_headers = scrapy_request_data["headers"].to_unicode_dict()
headers["Cookie"] = scrapy_headers.get("Cookie")
return headers

PLAYWRIGHT_PROCESS_REQUEST_HEADERS = custom_headers
Expand Down

0 comments on commit 3ec1285

Please sign in to comment.