app: add support for empty responses

If a dynamic request handler returns None with "wrap_result"
disabled, set the return status to 204.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2021-12-21 18:12:27 -05:00
parent b369173f94
commit e46b4994d4
1 changed files with 2 additions and 0 deletions

View File

@ -598,6 +598,8 @@ class DynamicRequestHandler(AuthorizedRequestHandler):
e.status_code, str(e)) from e
if self.wrap_result:
result = {'result': result}
if result is None:
self.set_status(204)
self._log_debug(f"HTTP Response::{req}", result)
self.finish(result)