From be656cf2c98aba4dc3c08fb06e25265067bb4fa4 Mon Sep 17 00:00:00 2001 From: Piotr Kozimor Date: Mon, 19 Apr 2021 13:13:38 +0200 Subject: [PATCH] Pass request to identity server with context from passed request --- clientapi/routing/register.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clientapi/routing/register.go b/clientapi/routing/register.go index 7ee308fff..3d99e1bae 100644 --- a/clientapi/routing/register.go +++ b/clientapi/routing/register.go @@ -1153,8 +1153,8 @@ func requestEmailTokenFromIdServer( util.GetLogger(ctx).WithError(err).Error("enc.Encode failed") return jsonerror.InternalServerError() } - idReq, err := http.NewRequest( - // ctx, + idReq, err := http.NewRequestWithContext( + ctx, "POST", fmt.Sprintf( "https://%s/_matrix/identity/v2/validate/email/requestToken", @@ -1166,8 +1166,6 @@ func requestEmailTokenFromIdServer( } idReq.Header.Add("Authentication", "Bearer "+idAccessToken) idReq.Header.Add("Content-Type", "application/json") - // util.GetLogger(ctx).WithError(err).Warnf("buffer %s") - // io.Copy(os.Stdout, &b) idResp, err := client.Do(idReq) if err != nil { util.GetLogger(ctx).WithError(err).Errorf("failed to connect to identity server %s", idServer)