Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(handler): fix download response header Content-Encoding error #322

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ coverage-twisted/
node_modules/
package-lock.json
package.json

.idea
4 changes: 3 additions & 1 deletion scrapy_playwright/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,12 @@ async def _download_request_with_page(
if download:
request.meta["playwright_suggested_filename"] = download.suggested_filename
respcls = responsetypes.from_args(url=download.url, body=download.body)
download_headers = Headers(download.headers)
download_headers.pop("Content-Encoding", None)
return respcls(
url=download.url,
status=download.response_status,
headers=Headers(download.headers),
headers=download_headers,
body=download.body,
request=request,
flags=["playwright"],
Expand Down