From 4d598a387f31c9ed19a10c62294a08b13ceead7b Mon Sep 17 00:00:00 2001 From: Max Varlamov Date: Wed, 24 May 2023 15:49:39 +0300 Subject: [PATCH] send headers in lowercase --- scrapypuppeteer/middleware.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scrapypuppeteer/middleware.py b/scrapypuppeteer/middleware.py index 4acd8a0..e7b7112 100644 --- a/scrapypuppeteer/middleware.py +++ b/scrapypuppeteer/middleware.py @@ -114,7 +114,7 @@ def _serialize_body(self, action, request): if include_headers: headers = request.headers.to_unicode_dict() if isinstance(include_headers, list): - headers = {h: headers[h] for h in include_headers if h in headers} + headers = {h.lower(): headers[h] for h in include_headers if h in headers} payload['headers'] = headers return json.dumps(payload) return str(payload) diff --git a/setup.py b/setup.py index 836aa29..06c5a7d 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name='scrapy-puppeteer-client', - version='0.0.7', + version='0.0.8', description='A library to use Puppeteer-managed browser in Scrapy spiders', long_description=long_description, long_description_content_type="text/markdown",