mirror of
https://github.com/elisspace/core.git
synced 2026-09-30 06:19:55 +00:00
Fix cors on the index view (#24283)
This commit is contained in:
@@ -140,3 +140,15 @@ async def test_cors_middleware_with_cors_allowed_view(hass):
|
||||
|
||||
hass.http.app._on_startup.freeze()
|
||||
await hass.http.app.startup()
|
||||
|
||||
|
||||
async def test_cors_works_with_frontend(hass, hass_client):
|
||||
"""Test CORS works with the frontend."""
|
||||
assert await async_setup_component(hass, 'frontend', {
|
||||
'http': {
|
||||
'cors_allowed_origins': ['http://home-assistant.io']
|
||||
}
|
||||
})
|
||||
client = await hass_client()
|
||||
resp = await client.get('/')
|
||||
assert resp.status == 200
|
||||
|
||||
Reference in New Issue
Block a user