summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-06-14 18:28:26 +0100
committerGitHub <noreply@github.com>2022-06-14 18:28:26 +0100
commitc99b511db950bff5129e717a225de78b95b9b5ad (patch)
treedade8b69e8bf3abf52f1a6f7824f2aa08f79e280 /synapse/http
parentUp complement time outs (#13048) (diff)
downloadsynapse-c99b511db950bff5129e717a225de78b95b9b5ad.tar.xz
Fix `destination_is` errors seen in sentry. (#13041)
* Rename test_fedclient to match its source file
* Require at least one destination to be truthy
* Explicitly validate user ID in profile endpoint GETs
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/matrixfederationclient.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py
index 776ed43f03..c63d068f74 100644
--- a/synapse/http/matrixfederationclient.py
+++ b/synapse/http/matrixfederationclient.py
@@ -731,8 +731,11 @@ class MatrixFederationHttpClient:
         Returns:
             A list of headers to be added as "Authorization:" headers
         """
-        if destination is None and destination_is is None:
-            raise ValueError("destination and destination_is cannot both be None!")
+        if not destination and not destination_is:
+            raise ValueError(
+                "At least one of the arguments destination and destination_is "
+                "must be a nonempty bytestring."
+            )
 
         request: JsonDict = {
             "method": method.decode("ascii"),