From 09a943d95727d4bb4a4734e7624492f97b9b41d0 Mon Sep 17 00:00:00 2001 From: FuNK3Y Date: Tue, 27 Oct 2026 08:06:08 +0100 Subject: [PATCH] aiohttp: Send the correct Host header when following a redirect. request_raw() added the Host header to the headers dict it was given, which is the same dict _request() passes again for each redirect. The Host of the original URL was therefore still present when following a redirect to another host, and was sent to that host instead of its own name. Work on a copy of the headers in request_raw() so the caller's dict is left unchanged. Co-Authored-By: Claude Opus 5.5 Signed-off-by: FuNK3Y --- python-ecosys/aiohttp/aiohttp/__init__.py | 1 + python-ecosys/aiohttp/manifest.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/python-ecosys/aiohttp/aiohttp/__init__.py b/python-ecosys/aiohttp/aiohttp/__init__.py index 8bcf7a89d..ac3e109d5 100644 --- a/python-ecosys/aiohttp/aiohttp/__init__.py +++ b/python-ecosys/aiohttp/aiohttp/__init__.py @@ -169,6 +169,7 @@ async def request_raw( is_handshake=False, version=None, ): + headers = headers.copy() if json and isinstance(json, dict): data = _json.dumps(json) if data is not None and method == "GET": diff --git a/python-ecosys/aiohttp/manifest.py b/python-ecosys/aiohttp/manifest.py index 13c903d31..a57031cfe 100644 --- a/python-ecosys/aiohttp/manifest.py +++ b/python-ecosys/aiohttp/manifest.py @@ -1,6 +1,6 @@ metadata( description="HTTP client module for MicroPython asyncio module", - version="0.0.8", + version="0.0.9", pypi="aiohttp", )