summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-02-27 11:40:55 +0100
committerAlvaro Neira Ayuso <aneira@soleta.eu>2020-03-02 09:32:40 +0100
commitb53f8d0f8f3daa51f6d2bf87c2fc2096c6bbdf78 (patch)
tree52d1d51c4f5d2cede21f577c5291b282e532d4a7
parenta85c113ee7aeaf7348de83fe3aa4dcd9d525a8bf (diff)
Send complete HTTP header when response has no body
-rw-r--r--src/ogRest.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ogRest.py b/src/ogRest.py
index c68eb0e..a35ff5d 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -63,7 +63,8 @@ class restResponse():
self.msg += '\r\nContent-Type: application/json'
self.msg += '\r\n\r\n' + json_body.dump()
else:
- self.msg += '\r\n'
+ self.msg += 'Content-Length: 0\r\n' \
+ 'Content-Type: application/json\r\n\r\n'
def get(self):