Fix unhandled KeyError exception when starting Docker container. Ref #1991

This commit is contained in:
grossmj
2021-11-04 16:59:35 +10:30
parent 1067e60284
commit b1a62dfdc2
2 changed files with 2 additions and 2 deletions

View File

@ -111,7 +111,7 @@ class Docker(BaseManager):
body = await response.read()
response.close()
if body and len(body):
if response.headers['CONTENT-TYPE'] == 'application/json':
if response.headers.get('CONTENT-TYPE') == 'application/json':
body = json.loads(body.decode("utf-8"))
else:
body = body.decode("utf-8")