diff --git a/homeassistant/components/http/cors.py b/homeassistant/components/http/cors.py index 69e7c7ea2d5..b7e53a6bebf 100644 --- a/homeassistant/components/http/cors.py +++ b/homeassistant/components/http/cors.py @@ -39,14 +39,14 @@ def setup_cors(app: Application, origins: list[str]) -> None: cors = aiohttp_cors.setup( app, defaults={ - host: aiohttp_cors.ResourceOptions( + host: aiohttp_cors.ResourceOptions( # type: ignore[no-untyped-call] allow_headers=ALLOWED_CORS_HEADERS, allow_methods="*" ) for host in origins }, ) - cors_added = set() + cors_added: set[str] = set() def _allow_cors( route: AbstractRoute | AbstractResource, @@ -69,13 +69,13 @@ def setup_cors(app: Application, origins: list[str]) -> None: if path_str in cors_added: return - cors.add(route, config) + cors.add(route, config) # type: ignore[arg-type] cors_added.add(path_str) app[KEY_ALLOW_ALL_CORS] = lambda route: _allow_cors( route, { - "*": aiohttp_cors.ResourceOptions( + "*": aiohttp_cors.ResourceOptions( # type: ignore[no-untyped-call] allow_headers=ALLOWED_CORS_HEADERS, allow_methods="*" ) }, diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 7b7541d5b69..858d101a3fd 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -7,7 +7,7 @@ aiohasupervisor==0.3.1 aiohttp-asyncmdnsresolver==0.1.1 aiohttp-fast-zlib==0.2.3 aiohttp==3.12.6 -aiohttp_cors==0.7.0 +aiohttp_cors==0.8.1 aiousbwatcher==1.1.1 aiozoneinfo==0.2.3 annotatedyaml==0.4.5 diff --git a/pyproject.toml b/pyproject.toml index 7ad16079d16..a2b87f653a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ dependencies = [ # Lib can be removed with 2025.11 "aiohasupervisor==0.3.1", "aiohttp==3.12.6", - "aiohttp_cors==0.7.0", + "aiohttp_cors==0.8.1", "aiohttp-fast-zlib==0.2.3", "aiohttp-asyncmdnsresolver==0.1.1", "aiozoneinfo==0.2.3", diff --git a/requirements.txt b/requirements.txt index 3667b1f193e..25fea3e0d2d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ aiodns==3.4.0 aiohasupervisor==0.3.1 aiohttp==3.12.6 -aiohttp_cors==0.7.0 +aiohttp_cors==0.8.1 aiohttp-fast-zlib==0.2.3 aiohttp-asyncmdnsresolver==0.1.1 aiozoneinfo==0.2.3