Skip to content

Commit ec64c3e

Browse files
kegsayreivilibre
andauthored
Ensure we /send PDUs which pass canonical JSON checks (#18641)
### Pull Request Checklist Fixes #18554 Looks like this was missed when it was [implemented](2277df2). <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [x] Pull request is based on the develop branch * [x] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [x] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters)) --------- Co-authored-by: reivilibre <[email protected]>
1 parent ada3a3b commit ec64c3e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

changelog.d/18641.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensure all PDUs sent via `/send` pass canonical JSON checks.

synapse/federation/sender/transaction_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from synapse.api.errors import HttpResponseException
2727
from synapse.events import EventBase
2828
from synapse.federation.persistence import TransactionActions
29-
from synapse.federation.units import Edu, Transaction
29+
from synapse.federation.units import Edu, Transaction, serialize_and_filter_pdus
3030
from synapse.logging.opentracing import (
3131
extract_text_map,
3232
set_tag,
@@ -119,7 +119,7 @@ async def send_new_transaction(
119119
transaction_id=txn_id,
120120
origin=self.server_name,
121121
destination=destination,
122-
pdus=[p.get_pdu_json() for p in pdus],
122+
pdus=serialize_and_filter_pdus(pdus),
123123
edus=[edu.get_dict() for edu in edus],
124124
)
125125

0 commit comments

Comments
 (0)