mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-03 00:54:47 -04:00
Be stricter about JSON that is accepted by Synapse (#8106)
This commit is contained in:
parent
d89692ea84
commit
eebf52be06
20 changed files with 85 additions and 62 deletions
|
@ -15,8 +15,6 @@
|
|||
import logging
|
||||
from typing import TYPE_CHECKING, List, Tuple
|
||||
|
||||
from canonicaljson import json
|
||||
|
||||
from synapse.api.errors import HttpResponseException
|
||||
from synapse.events import EventBase
|
||||
from synapse.federation.persistence import TransactionActions
|
||||
|
@ -28,6 +26,7 @@ from synapse.logging.opentracing import (
|
|||
tags,
|
||||
whitelisted_homeserver,
|
||||
)
|
||||
from synapse.util import json_decoder
|
||||
from synapse.util.metrics import measure_func
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
@ -71,7 +70,7 @@ class TransactionManager(object):
|
|||
for edu in pending_edus:
|
||||
context = edu.get_context()
|
||||
if context:
|
||||
span_contexts.append(extract_text_map(json.loads(context)))
|
||||
span_contexts.append(extract_text_map(json_decoder.decode(context)))
|
||||
if keep_destination:
|
||||
edu.strip_context()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue