return bad request on missing acc param instead of 500

This commit is contained in:
BluBb_mADe 2019-06-04 18:38:10 +02:00
parent 0bf1d470da
commit a62e7bc6de
Signed by: Gardener
GPG Key ID: 1FAEB4540A5B4D1D

View File

@ -47,7 +47,7 @@ def sizeof_fmt(num, suffix='B'):
async def prepare(_, handler): async def prepare(_, handler):
async def prepare_handler(req): async def prepare_handler(req):
if 'acc' not in req.match_info: if 'acc' not in req.match_info:
return web.Response(text='internal server error', status=500) return web.Response(text='bad request', status=400)
return await handler(req, req.match_info["acc"], file_db[req.match_info["acc"]]) return await handler(req, req.match_info["acc"], file_db[req.match_info["acc"]])
return prepare_handler return prepare_handler