Revert CORS changes for my home assistant (#47064)

* Revert CORS changes for my home assistant

* Update test_init.py

* Update test_init.py
This commit is contained in:
Bram Kragten 2021-02-26 00:28:22 +01:00 committed by GitHub
parent d084291055
commit e3105c7eb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 6 deletions

View file

@ -178,7 +178,6 @@ class APIDiscoveryView(HomeAssistantView):
requires_auth = False
url = URL_API_DISCOVERY_INFO
name = "api:discovery"
cors_allowed = True
async def get(self, request):
"""Get discovery information."""

View file

@ -59,7 +59,7 @@ _LOGGER = logging.getLogger(__name__)
DEFAULT_DEVELOPMENT = "0"
# Cast to be able to load custom cards.
# My to be able to check url and version info.
DEFAULT_CORS = ["https://cast.home-assistant.io", "https://my.home-assistant.io"]
DEFAULT_CORS = ["https://cast.home-assistant.io"]
NO_LOGIN_ATTEMPT_THRESHOLD = -1
MAX_CLIENT_SIZE: int = 1024 ** 2 * 16

View file

@ -175,10 +175,7 @@ async def test_cors_defaults(hass):
assert await async_setup_component(hass, "http", {})
assert len(mock_setup.mock_calls) == 1
assert mock_setup.mock_calls[0][1][1] == [
"https://cast.home-assistant.io",
"https://my.home-assistant.io",
]
assert mock_setup.mock_calls[0][1][1] == ["https://cast.home-assistant.io"]
async def test_storing_config(hass, aiohttp_client, aiohttp_unused_port):