Return empty JSON if we don't have any protocols to return
This should help with Element reporting `The homeserver may be too old
to support third party networks.`
@@ -36,11 +36,17 @@ 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.StatusOK,
+ JSON: struct{}{},
+ }
+ }
if protocol != "" {
return util.JSONResponse{
Code: http.StatusOK,
