aboutsummaryrefslogtreecommitdiff
path: root/clientapi/routing/membership.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-06-04 10:53:39 +0100
committerGitHub <noreply@github.com>2020-06-04 10:53:39 +0100
commit8a6152ca70aa86df651db54efb3b1ec68ec9ec78 (patch)
treeb08e70cd3c92f24968be0a5477d285be0dcb80cd /clientapi/routing/membership.go
parente21d7d4bafb8c785e75369bebd5270cc67cb36d4 (diff)
Enable room version 6 (#1087)
* Return bad request on CS API /send if bad JSON * Return some more M_BAD_JSON in the right places * nolint because damnit gocyclo all I added was a type check for an error * Update gomatrixserverlib * Update gomatrixserverlib * Update sytest-whitelist * Update gomatrixserverlib * Update sytest-whitelist * NotJSON -> BadJSON
Diffstat (limited to 'clientapi/routing/membership.go')
-rw-r--r--clientapi/routing/membership.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/clientapi/routing/membership.go b/clientapi/routing/membership.go
index cd0ce732..74d92a05 100644
--- a/clientapi/routing/membership.go
+++ b/clientapi/routing/membership.go
@@ -276,7 +276,13 @@ func checkAndProcessThreepid(
Code: http.StatusNotFound,
JSON: jsonerror.NotFound(err.Error()),
}
- } else if err != nil {
+ } else if e, ok := err.(gomatrixserverlib.BadJSONError); ok {
+ return inviteStored, &util.JSONResponse{
+ Code: http.StatusBadRequest,
+ JSON: jsonerror.BadJSON(e.Error()),
+ }
+ }
+ if err != nil {
util.GetLogger(req.Context()).WithError(err).Error("threepid.CheckAndProcessInvite failed")
er := jsonerror.InternalServerError()
return inviteStored, &er