diff options
Diffstat (limited to 'http_connection.h')
-rw-r--r-- | http_connection.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/http_connection.h b/http_connection.h index 3e1ae62..e2c21ff 100644 --- a/http_connection.h +++ b/http_connection.h @@ -60,6 +60,11 @@ namespace flask buffers_.clear(); buffers_.reserve(4*(res.headers.size()+4)+3); + if (res.body.empty() && res.json_value.t == json::type::Object) + { + res.body = json::encode(res.json_value); + } + if (!statusCodes.count(res.code)) res.code = 500; { |