mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-28 01:03:10 -06:00
Pass request to identity server with context from passed request
This commit is contained in:
parent
f6456468c0
commit
be656cf2c9
|
|
@ -1153,8 +1153,8 @@ func requestEmailTokenFromIdServer(
|
||||||
util.GetLogger(ctx).WithError(err).Error("enc.Encode failed")
|
util.GetLogger(ctx).WithError(err).Error("enc.Encode failed")
|
||||||
return jsonerror.InternalServerError()
|
return jsonerror.InternalServerError()
|
||||||
}
|
}
|
||||||
idReq, err := http.NewRequest(
|
idReq, err := http.NewRequestWithContext(
|
||||||
// ctx,
|
ctx,
|
||||||
"POST",
|
"POST",
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
"https://%s/_matrix/identity/v2/validate/email/requestToken",
|
"https://%s/_matrix/identity/v2/validate/email/requestToken",
|
||||||
|
|
@ -1166,8 +1166,6 @@ func requestEmailTokenFromIdServer(
|
||||||
}
|
}
|
||||||
idReq.Header.Add("Authentication", "Bearer "+idAccessToken)
|
idReq.Header.Add("Authentication", "Bearer "+idAccessToken)
|
||||||
idReq.Header.Add("Content-Type", "application/json")
|
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)
|
idResp, err := client.Do(idReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
util.GetLogger(ctx).WithError(err).Errorf("failed to connect to identity server %s", idServer)
|
util.GetLogger(ctx).WithError(err).Errorf("failed to connect to identity server %s", idServer)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue