From 40af9f2676928fdb87698f2fb0b472baa01d67e1 Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Wed, 31 Jan 2018 17:04:32 +0000 Subject: [PATCH] Correct use of middleware async handling. (#12078) --- homeassistant/components/http/auth.py | 4 ++-- homeassistant/components/http/static.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/http/auth.py b/homeassistant/components/http/auth.py index ce5bfca3ac1..a6a412b6ba2 100644 --- a/homeassistant/components/http/auth.py +++ b/homeassistant/components/http/auth.py @@ -23,7 +23,7 @@ def auth_middleware(request, handler): # If no password set, just always set authenticated=True if request.app['hass'].http.api_password is None: request[KEY_AUTHENTICATED] = True - return handler(request) + return (yield from handler(request)) # Check authentication authenticated = False @@ -46,7 +46,7 @@ def auth_middleware(request, handler): authenticated = True request[KEY_AUTHENTICATED] = authenticated - return handler(request) + return (yield from handler(request)) def is_trusted_ip(request): diff --git a/homeassistant/components/http/static.py b/homeassistant/components/http/static.py index c9b094e3f2e..74a5a8818a4 100644 --- a/homeassistant/components/http/static.py +++ b/homeassistant/components/http/static.py @@ -67,7 +67,7 @@ def staticresource_middleware(request, handler): """Middleware to strip out fingerprint from fingerprinted assets.""" path = request.path if not path.startswith('/static/') and not path.startswith('/frontend'): - return handler(request) + return (yield from handler(request)) fingerprinted = _FINGERPRINT.match(request.match_info['filename']) @@ -75,4 +75,4 @@ def staticresource_middleware(request, handler): request.match_info['filename'] = \ '{}.{}'.format(*fingerprinted.groups()) - return handler(request) + return (yield from handler(request))