mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Detect use of deprecated base_url (#35353)
* Detect use of deprecated base_url * Update get_url helper * Update core migration * Migrate all tests
This commit is contained in:
@@ -195,10 +195,10 @@ def _async_get_deprecated_base_url(
|
||||
require_standard_port: bool = False,
|
||||
) -> str:
|
||||
"""Work with the deprecated `base_url`, used as fallback."""
|
||||
if hass.config.api is None or not hass.config.api.base_url:
|
||||
if hass.config.api is None or not hass.config.api.deprecated_base_url:
|
||||
raise NoURLAvailableError
|
||||
|
||||
base_url = yarl.URL(hass.config.api.base_url)
|
||||
base_url = yarl.URL(hass.config.api.deprecated_base_url)
|
||||
# Rules that apply to both internal and external
|
||||
if (
|
||||
(allow_ip or not is_ip_address(str(base_url.host)))
|
||||
|
||||
Reference in New Issue
Block a user