mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Set a content-length for JSON responses
This commit is contained in:
parent
78edb47cc5
commit
773de09774
@ -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 New Issue
Block a user