From aeee46bb7159c610835036769aea43d391e04eb1 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Wed, 19 Jun 2024 12:02:47 +0200 Subject: [PATCH] Announce support for MSC3916, fix wrong JSON message on error --- clientapi/routing/routing.go | 1 + internal/httputil/httpapi.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index ced75303e..4e7a05b82 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -94,6 +94,7 @@ func Setup( unstableFeatures := map[string]bool{ "org.matrix.e2e_cross_signing": true, "org.matrix.msc2285.stable": true, + "org.matrix.msc3916": true, } for _, msc := range cfg.MSCs.MSCs { unstableFeatures["org.matrix."+msc] = true diff --git a/internal/httputil/httpapi.go b/internal/httputil/httpapi.go index 26b2f4d73..921c12a0e 100644 --- a/internal/httputil/httpapi.go +++ b/internal/httputil/httpapi.go @@ -226,7 +226,7 @@ func MakeHTMLAPI(metricsName string, userAPI userapi.QueryAcccessTokenAPI, enabl if jsonErr != nil { logger.Debugf("VerifyUserFromRequest %s -> HTTP %d", req.RemoteAddr, jsonErr.Code) w.WriteHeader(jsonErr.Code) - if err := json.NewEncoder(w).Encode(jsonErr); err != nil { + if err := json.NewEncoder(w).Encode(jsonErr.JSON); err != nil { logger.WithError(err).Error("failed to encode JSON response") } return