aboutsummaryrefslogtreecommitdiff
path: root/clientapi
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-11-28 11:26:03 +0100
committerGitHub <noreply@github.com>2022-11-28 11:26:03 +0100
commit5e4b461e0158daa76872956729b73ccdccefbf10 (patch)
tree513bdcef1c8615af56382c473f011430327978a8 /clientapi
parent31f56ac3f43b692a56718fd1acfcb5a46e485c57 (diff)
Return empty JSON if we don't have any protocols to return (#2892)
This should help with Element reporting `The homeserver may be too old to support third party networks.`
Diffstat (limited to 'clientapi')
-rw-r--r--clientapi/routing/thirdparty.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/clientapi/routing/thirdparty.go b/clientapi/routing/thirdparty.go
index e757cd41..7a62da44 100644
--- a/clientapi/routing/thirdparty.go
+++ b/clientapi/routing/thirdparty.go
@@ -36,9 +36,15 @@ func Protocols(req *http.Request, asAPI appserviceAPI.AppServiceInternalAPI, dev
return jsonerror.InternalServerError()
}
if !resp.Exists {
+ if protocol != "" {
+ return util.JSONResponse{
+ Code: http.StatusNotFound,
+ JSON: jsonerror.NotFound("The protocol is unknown."),
+ }
+ }
return util.JSONResponse{
- Code: http.StatusNotFound,
- JSON: jsonerror.NotFound("The protocol is unknown."),
+ Code: http.StatusOK,
+ JSON: struct{}{},
}
}
if protocol != "" {