You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2021/06/04 10:02:48 UTC
[incubator-ponymail-foal] branch master updated: Only set JSON type
if applicable
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new f1c2e09 Only set JSON type if applicable
f1c2e09 is described below
commit f1c2e09131bbd4fdc6fc09169b4354e80a12b83e
Author: Sebb <se...@apache.org>
AuthorDate: Fri Jun 4 11:02:35 2021 +0100
Only set JSON type if applicable
---
server/main.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/main.py b/server/main.py
index 8b8cb0e..3e76209 100644
--- a/server/main.py
+++ b/server/main.py
@@ -121,9 +121,9 @@ class Server(plugins.server.BaseServer):
session.database = None
if isinstance(output, aiohttp.web.Response):
return output
- headers["content-type"] = "application/json"
if output:
jsout = await self.runners.run(json.dumps, output, indent=2)
+ headers["content-type"] = "application/json"
headers["Content-Length"] = str(len(jsout))
return aiohttp.web.Response(headers=headers, status=200, text=jsout)
return aiohttp.web.Response(