From 8e8b66a4b8f9c2e042a399f19e23181274bde92d Mon Sep 17 00:00:00 2001 From: Mitchell Stern Date: Thu, 16 Jan 2020 19:03:21 -0800 Subject: [PATCH] Add route for /favicon.ico to fix missing favicon (#6815) --- python/ray/dashboard/dashboard.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/ray/dashboard/dashboard.py b/python/ray/dashboard/dashboard.py index 47128064a..eeb6a8aac 100644 --- a/python/ray/dashboard/dashboard.py +++ b/python/ray/dashboard/dashboard.py @@ -128,6 +128,12 @@ class Dashboard(object): os.path.dirname(os.path.abspath(__file__)), "client/build/index.html")) + async def get_favicon(req) -> aiohttp.web.Response: + return aiohttp.web.FileResponse( + os.path.join( + os.path.dirname(os.path.abspath(__file__)), + "client/build/favicon.ico")) + async def json_response(result=None, error=None, ts=None) -> aiohttp.web.Response: if ts is None: @@ -249,6 +255,7 @@ class Dashboard(object): return await json_response(result=result) self.app.router.add_get("/", get_index) + self.app.router.add_get("/favicon.ico", get_favicon) static_dir = os.path.join( os.path.dirname(os.path.abspath(__file__)), "client/build/static")