|
|
@@ -117,11 +117,12 @@ class AuthMiddleware:
|
|
|
for device in app.cache['devices']:
|
|
|
if ((header == bytes('{}_{}'.format(app.config['AUTH_HEADER'].lower(), device), 'utf-8')) and
|
|
|
(value == bytes(app.cache['devices'][device], 'utf-8'))):
|
|
|
+ body = bytes('scope: {}'.format(pformat(getmembers(scope), indent=1)), 'utf-8')
|
|
|
await send({'type': 'http.response.start',
|
|
|
'status': 200,
|
|
|
- 'headers': [(b'content-length', b'500000')]})
|
|
|
+ 'headers': [(b'content-length', bytes(str(len(body))))]})
|
|
|
await send({'type': 'http.response.body',
|
|
|
- 'body': bytes('scope: {}'.format(pformat(getmembers(scope), indent=1)), 'utf-8'),
|
|
|
+ 'body': body,
|
|
|
'more_body': False})
|
|
|
|
|
|
return await self.app(scope, receive, send)
|