mirror of
https://github.com/home-assistant/core.git
synced 2025-12-27 06:28:31 +00:00
Allow CORS requests to token endpoint (#15519)
* Allow CORS requests to token endpoint * Tests * Fuck emulated hue * Clean up * Only cors existing methods
This commit is contained in:
@@ -19,14 +19,14 @@ from homeassistant.components.http.cors import setup_cors
|
||||
TRUSTED_ORIGIN = 'https://home-assistant.io'
|
||||
|
||||
|
||||
async def test_cors_middleware_not_loaded_by_default(hass):
|
||||
async def test_cors_middleware_loaded_by_default(hass):
|
||||
"""Test accessing to server from banned IP when feature is off."""
|
||||
with patch('homeassistant.components.http.setup_cors') as mock_setup:
|
||||
await async_setup_component(hass, 'http', {
|
||||
'http': {}
|
||||
})
|
||||
|
||||
assert len(mock_setup.mock_calls) == 0
|
||||
assert len(mock_setup.mock_calls) == 1
|
||||
|
||||
|
||||
async def test_cors_middleware_loaded_from_config(hass):
|
||||
|
||||
Reference in New Issue
Block a user