summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-01-06 13:05:07 +0000
committerMark Haines <mark.haines@matrix.org>2015-01-06 13:05:19 +0000
commit773de09774399692cb43d56587ae77cbbee42d01 (patch)
tree0dce913fd74cd111c52da5b200ee9bb9586400f5
parentSYN-208/SYN-228: Add runtime checks on startup to enforce that JPEG/PNG suppo... (diff)
downloadsynapse-773de09774399692cb43d56587ae77cbbee42d01.tar.xz
Set a content-length for JSON responses
Diffstat (limited to '')
-rw-r--r--synapse/http/server.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py
index 5765dffe39..de26afb48a 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -233,6 +233,7 @@ def respond_with_json_bytes(request, code, json_bytes, send_cors=False,
     request.setResponseCode(code, message=response_code_message)
     request.setHeader(b"Content-Type", b"application/json")
     request.setHeader(b"Server", AGENT_NAME)
+    request.setHeader(b"Content-Length", b"%d" % len(json_bytes))
 
     if send_cors:
         request.setHeader("Access-Control-Allow-Origin", "*")