From 95a038c1069de6c0507eb2c2d9a783c5033a70ec Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 8 Apr 2022 13:06:51 +0100 Subject: Unify HTTP query parameter type hints (#12415) * Pull out query param types to `synapse.http.types` * Use QueryParams everywhere * Simplify `encode_query_args` * Add annotation which would have caught #12410 --- synapse/federation/transport/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'synapse/federation/transport') diff --git a/synapse/federation/transport/client.py b/synapse/federation/transport/client.py index 66a41e45fc..01dc5ca94f 100644 --- a/synapse/federation/transport/client.py +++ b/synapse/federation/transport/client.py @@ -44,6 +44,7 @@ from synapse.api.urls import ( from synapse.events import EventBase, make_event_from_dict from synapse.federation.units import Transaction from synapse.http.matrixfederationclient import ByteParser +from synapse.http.types import QueryParams from synapse.types import JsonDict logger = logging.getLogger(__name__) @@ -255,7 +256,7 @@ class TransportLayerClient: self, destination: str, query_type: str, - args: dict, + args: QueryParams, retry_on_dns_fail: bool, ignore_backoff: bool = False, prefix: str = FEDERATION_V1_PREFIX, @@ -503,7 +504,7 @@ class TransportLayerClient: else: path = _create_v1_path("/publicRooms") - args: Dict[str, Any] = { + args: Dict[str, Union[str, Iterable[str]]] = { "include_all_networks": "true" if include_all_networks else "false" } if third_party_instance_id: -- cgit 1.4.1