1
0
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:
Paulus Schoutsen
2018-07-19 08:37:00 +02:00
committed by GitHub
parent 22d961de70
commit 2a76a0852f
9 changed files with 59 additions and 23 deletions

View File

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