mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-13 04:50:21 +00:00
Fix root path requests (#5815)
* Fix root path requests Since #5759 we've tried to access the path explicitly. However, this raises KeyError exception when trying to access the proxied root path (e.g. http://supervisor/core/api/). Before #5759 get was used, which lead to no exception, but instead inserted a `None` into the path. It seems aiohttp doesn't provide a path when the root is accessed. So simply convert this to no path as well by setting path to an empty string. * Add rudimentary pytest for regular proxy requets
This commit is contained in:
@@ -117,7 +117,7 @@ class APIProxy(CoreSysAttributes):
|
||||
raise HTTPBadGateway()
|
||||
|
||||
# Normal request
|
||||
path = request.match_info["path"]
|
||||
path = request.match_info.get("path", "")
|
||||
async with self._api_client(request, path) as client:
|
||||
data = await client.read()
|
||||
return web.Response(
|
||||
|
||||
Reference in New Issue
Block a user