mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 06:54:54 -04:00
Iteratively encode JSON responses to avoid blocking the reactor. (#8013)
This commit is contained in:
parent
25e55d2598
commit
2f4d60a5ba
5 changed files with 94 additions and 13 deletions
|
@ -15,12 +15,12 @@
|
|||
import logging
|
||||
from typing import Dict, Set
|
||||
|
||||
from canonicaljson import encode_canonical_json, json
|
||||
from canonicaljson import json
|
||||
from signedjson.sign import sign_json
|
||||
|
||||
from synapse.api.errors import Codes, SynapseError
|
||||
from synapse.crypto.keyring import ServerKeyFetcher
|
||||
from synapse.http.server import DirectServeJsonResource, respond_with_json_bytes
|
||||
from synapse.http.server import DirectServeJsonResource, respond_with_json
|
||||
from synapse.http.servlet import parse_integer, parse_json_object_from_request
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -223,4 +223,4 @@ class RemoteKey(DirectServeJsonResource):
|
|||
|
||||
results = {"server_keys": signed_keys}
|
||||
|
||||
respond_with_json_bytes(request, 200, encode_canonical_json(results))
|
||||
respond_with_json(request, 200, results, canonical_json=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue