Announce support for MSC3916, fix wrong JSON message on error

This commit is contained in:
Till Faelligen 2024-06-19 12:02:47 +02:00
parent 89d64c6dca
commit aeee46bb71
No known key found for this signature in database
GPG key ID: ACCDC9606D472758
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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