From 42d8710f38d465904dfe2823d132c299b94f7a3a Mon Sep 17 00:00:00 2001
From: reivilibre <oliverw@matrix.org>
Date: Tue, 5 Apr 2022 12:45:36 +0100
Subject: [PATCH] Fix a spec compliance issue where requests to the
 `/publicRooms` federation API would specify `limit` as a string. (#12364)

---
 changelog.d/12364.bugfix               | 1 +
 synapse/federation/transport/client.py | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
 create mode 100644 changelog.d/12364.bugfix

diff --git a/changelog.d/12364.bugfix b/changelog.d/12364.bugfix
new file mode 100644
index 0000000000..d042425d20
--- /dev/null
+++ b/changelog.d/12364.bugfix
@@ -0,0 +1 @@
+Fix a spec compliance issue where requests to the `/publicRooms` federation API would specify `limit` as a string.
\ No newline at end of file
diff --git a/synapse/federation/transport/client.py b/synapse/federation/transport/client.py
index de6e5f44fe..d4b3cb3e98 100644
--- a/synapse/federation/transport/client.py
+++ b/synapse/federation/transport/client.py
@@ -481,7 +481,7 @@ class TransportLayerClient:
             if third_party_instance_id:
                 data["third_party_instance_id"] = third_party_instance_id
             if limit:
-                data["limit"] = str(limit)
+                data["limit"] = limit
             if since_token:
                 data["since"] = since_token
 
@@ -509,7 +509,7 @@ class TransportLayerClient:
             if third_party_instance_id:
                 args["third_party_instance_id"] = (third_party_instance_id,)
             if limit:
-                args["limit"] = [str(limit)]
+                args["limit"] = [limit]
             if since_token:
                 args["since"] = [since_token]
 
-- 
GitLab