diff --git a/homeassistant/components/lutron_caseta/manifest.json b/homeassistant/components/lutron_caseta/manifest.json index f6bba1ab2a34..d0c203cccb4b 100644 --- a/homeassistant/components/lutron_caseta/manifest.json +++ b/homeassistant/components/lutron_caseta/manifest.json @@ -10,7 +10,7 @@ "integration_type": "hub", "iot_class": "local_push", "loggers": ["pylutron_caseta"], - "requirements": ["pylutron-caseta==0.29.0"], + "requirements": ["pylutron-caseta==0.30.0"], "zeroconf": [ { "properties": { diff --git a/homeassistant/const.py b/homeassistant/const.py index bd6b29a28f58..6c40cc8d464b 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -23,7 +23,7 @@ if TYPE_CHECKING: APPLICATION_NAME: Final = "HomeAssistant" MAJOR_VERSION: Final = 2026 MINOR_VERSION: Final = 10 -PATCH_VERSION: Final = "3" +PATCH_VERSION: Final = "4" __short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__: Final = f"{__short_version__}.{PATCH_VERSION}" REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 14, 2) diff --git a/homeassistant/helpers/aiohttp_client.py b/homeassistant/helpers/aiohttp_client.py index 2529005c293a..f2aa3a335c1f 100644 --- a/homeassistant/helpers/aiohttp_client.py +++ b/homeassistant/helpers/aiohttp_client.py @@ -157,6 +157,10 @@ async def _async_is_blocked_host( MAXIMUM_CONNECTIONS = 4096 MAXIMUM_CONNECTIONS_PER_HOST = 100 +# aiohttp's 8190 byte default is too small for some servers, e.g. GitHub's +# release download redirects carry a ~9 KiB Content-Security-Policy header. +MAXIMUM_HEADER_SIZE = 65536 + class HassAsyncDNSResolver(AsyncDualMDNSResolver): """Home Assistant AsyncDNSResolver. @@ -290,6 +294,9 @@ def _async_create_clientsession( *kwargs.pop("middlewares", ()), ) + kwargs.setdefault("max_line_size", MAXIMUM_HEADER_SIZE) + kwargs.setdefault("max_field_size", MAXIMUM_HEADER_SIZE) + clientsession = aiohttp.ClientSession( connector=_async_get_connector(hass, verify_ssl, family, ssl_cipher), json_serialize=json_dumps, diff --git a/pyproject.toml b/pyproject.toml index 4270bc455990..e205844f9dbe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "homeassistant" -version = "2026.10.3" +version = "2026.10.4" license = "Apache-2.0" license-files = ["LICENSE*", "homeassistant/backports/LICENSE*"] description = "Open-source home automation platform running on Python 3." diff --git a/requirements_all.txt b/requirements_all.txt index 14379fccafae..5c0da0127012 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2397,7 +2397,7 @@ pylitejet==0.6.3 pylitterbot==2025.6.5 # homeassistant.components.lutron_caseta -pylutron-caseta==0.29.0 +pylutron-caseta==0.30.0 # homeassistant.components.lutron pylutron==0.4.4 diff --git a/tests/helpers/test_aiohttp_client.py b/tests/helpers/test_aiohttp_client.py index e763ad208c4e..3b343db7204c 100644 --- a/tests/helpers/test_aiohttp_client.py +++ b/tests/helpers/test_aiohttp_client.py @@ -690,3 +690,22 @@ async def test_redirect_to_blocked_address( pytest.raises(client.SSRFRedirectError), ): await session.get(redirect_url) + + +@pytest.mark.usefixtures("socket_enabled") +async def test_clientsession_accepts_large_headers(hass: HomeAssistant) -> None: + """Test the clientsession reads header fields larger than aiohttp's default limit.""" + large_value = "x" * 9300 + + async def handler(request: web.Request) -> web.Response: + """Return a response with a header field larger than 8190 bytes.""" + return web.Response(text="ok", headers={"Content-Security-Policy": large_value}) + + app = web.Application() + app.router.add_get("/", handler) + + async with TestServer(app) as server: + session = client.async_get_clientsession(hass) + async with session.get(server.make_url("/")) as resp: + assert resp.status == 200 + assert resp.headers["Content-Security-Policy"] == large_value