1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-20 15:30:26 +01:00

add /local to no auth sig required urls (#171140)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: balloob <1444314+balloob@users.noreply.github.com>
This commit is contained in:
Paulus Schoutsen
2026-05-19 00:55:47 -04:00
committed by GitHub
parent 11cbf91563
commit e675423c3c
2 changed files with 11 additions and 0 deletions
@@ -23,6 +23,7 @@ from .const import CONTENT_AUTH_EXPIRY_TIME, MediaClass, MediaType
# Paths that we don't need to sign
PATHS_WITHOUT_AUTH = (
"/local/",
"/api/tts_proxy/",
"/api/esphome/ffmpeg_proxy/",
"/api/assist_satellite/static/",
@@ -83,12 +83,22 @@ async def test_process_play_media_url(hass: HomeAssistant, mock_sign_path) -> No
async_process_play_media_url(hass, "/api/tts_proxy/bla")
== "http://example.local:8123/api/tts_proxy/bla"
)
assert (
async_process_play_media_url(hass, "/local/bla")
== "http://example.local:8123/local/bla"
)
assert (
async_process_play_media_url(
hass, "http://example.local:8123/api/tts_proxy/bla"
)
== "http://example.local:8123/api/tts_proxy/bla"
)
assert (
async_process_play_media_url(
hass, "http://example.local:8123/api/assist_satellite/static/bla"
)
== "http://example.local:8123/api/assist_satellite/static/bla"
)
# Not changing a URL which is not absolute and does not start with /
assert async_process_play_media_url(hass, "hello") == "hello"