Use rel_url for looking up frontend panels (#90149)

* Use rel_url for looking up frontend panels

request.url builds a new URL every time where-as
rel_url is always available

https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.BaseRequest.rel_url

* Use rel_url for looking up frontend panels

request.url builds a new URL every time where-as
rel_url is always available

https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.BaseRequest.rel_url
pull/90118/head
J. Nick Koston 2023-03-22 18:14:54 -10:00 committed by GitHub
parent 12352b2ce1
commit 9878738321
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -530,8 +530,9 @@ class IndexView(web_urldispatcher.AbstractResource):
"""
if (
request.path != "/"
and len(request.url.parts) > 1
and request.url.parts[1] not in self.hass.data[DATA_PANELS]
and (parts := request.rel_url.parts)
and len(parts) > 1
and parts[1] not in self.hass.data[DATA_PANELS]
):
return None, set()