diff options
author | David Robertson <davidr@element.io> | 2022-04-08 13:06:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-08 13:06:51 +0100 |
commit | 95a038c1069de6c0507eb2c2d9a783c5033a70ec (patch) | |
tree | 782b33d85db7ef0b54e9e49a9d629b7675a52334 /synapse/federation/transport/client.py | |
parent | Update the server notices user profile in room if changed. (#12115) (diff) | |
download | synapse-95a038c1069de6c0507eb2c2d9a783c5033a70ec.tar.xz |
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
Diffstat (limited to 'synapse/federation/transport/client.py')
-rw-r--r-- | synapse/federation/transport/client.py | 5 |
1 files changed, 3 insertions, 2 deletions
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: |