Update aiohttp-cors to 0.8.1 (#145976)

* Update aiohttp-cors to 0.8.1

* Fix mypy
This commit is contained in:
Marc Mueller 2025-06-02 07:52:23 +02:00 committed by GitHub
parent 885367e690
commit 17542614b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 7 deletions

View File

@ -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="*"
)
},

View File

@ -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

View File

@ -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",

2
requirements.txt generated
View File

@ -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