From 83c9dde219440e0d730d63d2d65fc9eaaea64762 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Mon, 17 Oct 2022 07:27:11 +0200 Subject: [PATCH 1/2] Return error if we fail to read the response body --- cmd/create-account/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/create-account/main.go b/cmd/create-account/main.go index 52301415f..c8e239f29 100644 --- a/cmd/create-account/main.go +++ b/cmd/create-account/main.go @@ -179,7 +179,10 @@ func sharedSecretRegister(sharedSecret, serverURL, localpart, password string, a body, _ = io.ReadAll(regResp.Body) return "", fmt.Errorf(gjson.GetBytes(body, "error").Str) } - r, _ := io.ReadAll(regResp.Body) + r, err := io.ReadAll(regResp.Body) + if err != nil { + return "", fmt.Errorf("failed to read response body (HTTP %d): %w", regResp.StatusCode, err) + } return gjson.GetBytes(r, "access_token").Str, nil } From d72d4f8d5d0016a8dcbf77aba92671f3469eb630 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 17 Oct 2022 10:38:22 +0100 Subject: [PATCH 2/2] Set `org.matrix.msc2285.stable` in `/versions` --- clientapi/routing/routing.go | 1 + 1 file changed, 1 insertion(+) diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index e72880ec5..ec5ca899e 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -70,6 +70,7 @@ func Setup( unstableFeatures := map[string]bool{ "org.matrix.e2e_cross_signing": true, + "org.matrix.msc2285.stable": true, } for _, msc := range cfg.MSCs.MSCs { unstableFeatures["org.matrix."+msc] = true