mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Update aiohttp-cors to 0.8.1 (#145976)
* Update aiohttp-cors to 0.8.1 * Fix mypy
This commit is contained in:
parent
885367e690
commit
17542614b5
@ -39,14 +39,14 @@ def setup_cors(app: Application, origins: list[str]) -> None:
|
|||||||
cors = aiohttp_cors.setup(
|
cors = aiohttp_cors.setup(
|
||||||
app,
|
app,
|
||||||
defaults={
|
defaults={
|
||||||
host: aiohttp_cors.ResourceOptions(
|
host: aiohttp_cors.ResourceOptions( # type: ignore[no-untyped-call]
|
||||||
allow_headers=ALLOWED_CORS_HEADERS, allow_methods="*"
|
allow_headers=ALLOWED_CORS_HEADERS, allow_methods="*"
|
||||||
)
|
)
|
||||||
for host in origins
|
for host in origins
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
cors_added = set()
|
cors_added: set[str] = set()
|
||||||
|
|
||||||
def _allow_cors(
|
def _allow_cors(
|
||||||
route: AbstractRoute | AbstractResource,
|
route: AbstractRoute | AbstractResource,
|
||||||
@ -69,13 +69,13 @@ def setup_cors(app: Application, origins: list[str]) -> None:
|
|||||||
if path_str in cors_added:
|
if path_str in cors_added:
|
||||||
return
|
return
|
||||||
|
|
||||||
cors.add(route, config)
|
cors.add(route, config) # type: ignore[arg-type]
|
||||||
cors_added.add(path_str)
|
cors_added.add(path_str)
|
||||||
|
|
||||||
app[KEY_ALLOW_ALL_CORS] = lambda route: _allow_cors(
|
app[KEY_ALLOW_ALL_CORS] = lambda route: _allow_cors(
|
||||||
route,
|
route,
|
||||||
{
|
{
|
||||||
"*": aiohttp_cors.ResourceOptions(
|
"*": aiohttp_cors.ResourceOptions( # type: ignore[no-untyped-call]
|
||||||
allow_headers=ALLOWED_CORS_HEADERS, allow_methods="*"
|
allow_headers=ALLOWED_CORS_HEADERS, allow_methods="*"
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
@ -7,7 +7,7 @@ aiohasupervisor==0.3.1
|
|||||||
aiohttp-asyncmdnsresolver==0.1.1
|
aiohttp-asyncmdnsresolver==0.1.1
|
||||||
aiohttp-fast-zlib==0.2.3
|
aiohttp-fast-zlib==0.2.3
|
||||||
aiohttp==3.12.6
|
aiohttp==3.12.6
|
||||||
aiohttp_cors==0.7.0
|
aiohttp_cors==0.8.1
|
||||||
aiousbwatcher==1.1.1
|
aiousbwatcher==1.1.1
|
||||||
aiozoneinfo==0.2.3
|
aiozoneinfo==0.2.3
|
||||||
annotatedyaml==0.4.5
|
annotatedyaml==0.4.5
|
||||||
|
@ -29,7 +29,7 @@ dependencies = [
|
|||||||
# Lib can be removed with 2025.11
|
# Lib can be removed with 2025.11
|
||||||
"aiohasupervisor==0.3.1",
|
"aiohasupervisor==0.3.1",
|
||||||
"aiohttp==3.12.6",
|
"aiohttp==3.12.6",
|
||||||
"aiohttp_cors==0.7.0",
|
"aiohttp_cors==0.8.1",
|
||||||
"aiohttp-fast-zlib==0.2.3",
|
"aiohttp-fast-zlib==0.2.3",
|
||||||
"aiohttp-asyncmdnsresolver==0.1.1",
|
"aiohttp-asyncmdnsresolver==0.1.1",
|
||||||
"aiozoneinfo==0.2.3",
|
"aiozoneinfo==0.2.3",
|
||||||
|
2
requirements.txt
generated
2
requirements.txt
generated
@ -6,7 +6,7 @@
|
|||||||
aiodns==3.4.0
|
aiodns==3.4.0
|
||||||
aiohasupervisor==0.3.1
|
aiohasupervisor==0.3.1
|
||||||
aiohttp==3.12.6
|
aiohttp==3.12.6
|
||||||
aiohttp_cors==0.7.0
|
aiohttp_cors==0.8.1
|
||||||
aiohttp-fast-zlib==0.2.3
|
aiohttp-fast-zlib==0.2.3
|
||||||
aiohttp-asyncmdnsresolver==0.1.1
|
aiohttp-asyncmdnsresolver==0.1.1
|
||||||
aiozoneinfo==0.2.3
|
aiozoneinfo==0.2.3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user