Fix cors on the index view (#24283)
This commit is contained in:
1 parent
ee71d2ca60
commit
014cc14b7e
2 files changed
+17
No files matched your search
@@ -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