forked from MirrorHub/synapse
Set a content-length for JSON responses
This commit is contained in:
parent
78edb47cc5
commit
773de09774
1 changed files with 1 additions and 0 deletions
|
@ -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", "*")
|
||||
|
|
Loading…
Reference in a new issue