Correct use of middleware async handling. (#12078)

pull/12091/head
Phil Elson 2018-01-31 17:04:32 +00:00 committed by Paulus Schoutsen
parent 424fe95ce4
commit 40af9f2676
2 changed files with 4 additions and 4 deletions

View File

@ -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):

View File

@ -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))