mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 11:41:38 +00:00
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.`
This commit is contained in:
parent
31f56ac3f4
commit
5e4b461e01
@ -36,11 +36,17 @@ func Protocols(req *http.Request, asAPI appserviceAPI.AppServiceInternalAPI, dev
|
|||||||
return jsonerror.InternalServerError()
|
return jsonerror.InternalServerError()
|
||||||
}
|
}
|
||||||
if !resp.Exists {
|
if !resp.Exists {
|
||||||
|
if protocol != "" {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusNotFound,
|
Code: http.StatusNotFound,
|
||||||
JSON: jsonerror.NotFound("The protocol is unknown."),
|
JSON: jsonerror.NotFound("The protocol is unknown."),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return util.JSONResponse{
|
||||||
|
Code: http.StatusOK,
|
||||||
|
JSON: struct{}{},
|
||||||
|
}
|
||||||
|
}
|
||||||
if protocol != "" {
|
if protocol != "" {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusOK,
|
Code: http.StatusOK,
|
||||||
|
Loading…
Reference in New Issue
Block a user