From 2155a861cdede6604fb72d5acc8c7a67658702af Mon Sep 17 00:00:00 2001 From: Jason Hu Date: Sat, 16 Feb 2019 23:06:42 -0800 Subject: [PATCH] Remove outdated url pattern match support for static file hosting (#21109) --- homeassistant/components/http/__init__.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/homeassistant/components/http/__init__.py b/homeassistant/components/http/__init__.py index cdbbbe551ab..7dca332058c 100644 --- a/homeassistant/components/http/__init__.py +++ b/homeassistant/components/http/__init__.py @@ -277,19 +277,7 @@ class HomeAssistantHTTP: """Serve file from disk.""" return web.FileResponse(path) - # aiohttp supports regex matching for variables. Using that as temp - # to work around cache busting MD5. - # Turns something like /static/dev-panel.html into - # /static/{filename:dev-panel(-[a-z0-9]{32}|)\.html} - base, ext = os.path.splitext(url_path) - if ext: - base, file = base.rsplit('/', 1) - regex = r"{}(-[a-z0-9]{{32}}|){}".format(file, ext) - url_pattern = "{}/{{filename:{}}}".format(base, regex) - else: - url_pattern = url_path - - self.app.router.add_route('GET', url_pattern, serve_file) + self.app.router.add_route('GET', url_path, serve_file) async def start(self): """Start the aiohttp server."""