Send proper JSON POST data to /publicRooms (#16185)
The include_all_networks was previously sent in the JSON body as string "true" and "false" instead of boolean true and false.pull/16186/head
parent
a8a46b1336
commit
fcf7a5759e
|
@ -0,0 +1 @@
|
|||
Fix a spec compliance issue where requests to the `/publicRooms` federation API would specify `include_all_networks` as a string.
|
|
@ -475,13 +475,11 @@ class TransportLayerClient:
|
|||
See synapse.federation.federation_client.FederationClient.get_public_rooms for
|
||||
more information.
|
||||
"""
|
||||
if search_filter:
|
||||
# this uses MSC2197 (Search Filtering over Federation)
|
||||
path = _create_v1_path("/publicRooms")
|
||||
|
||||
data: Dict[str, Any] = {
|
||||
"include_all_networks": "true" if include_all_networks else "false"
|
||||
}
|
||||
if search_filter:
|
||||
# this uses MSC2197 (Search Filtering over Federation)
|
||||
data: Dict[str, Any] = {"include_all_networks": include_all_networks}
|
||||
if third_party_instance_id:
|
||||
data["third_party_instance_id"] = third_party_instance_id
|
||||
if limit:
|
||||
|
@ -505,17 +503,15 @@ class TransportLayerClient:
|
|||
)
|
||||
raise
|
||||
else:
|
||||
path = _create_v1_path("/publicRooms")
|
||||
|
||||
args: Dict[str, Union[str, Iterable[str]]] = {
|
||||
"include_all_networks": "true" if include_all_networks else "false"
|
||||
}
|
||||
if third_party_instance_id:
|
||||
args["third_party_instance_id"] = (third_party_instance_id,)
|
||||
args["third_party_instance_id"] = third_party_instance_id
|
||||
if limit:
|
||||
args["limit"] = [str(limit)]
|
||||
args["limit"] = str(limit)
|
||||
if since_token:
|
||||
args["since"] = [since_token]
|
||||
args["since"] = since_token
|
||||
|
||||
try:
|
||||
response = await self.client.get_json(
|
||||
|
|
Loading…
Reference in New Issue