mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
federation: fix signing requests with no body
This commit is contained in:
parent
4f5dea4ca2
commit
9b517179dc
1 changed files with 5 additions and 1 deletions
|
|
@ -332,12 +332,16 @@ func (c *Client) compileRequest(ctx context.Context, params RequestParams) (*htt
|
|||
Message: "client not configured for authentication",
|
||||
}
|
||||
}
|
||||
var contentAny any
|
||||
if reqJSON != nil {
|
||||
contentAny = reqJSON
|
||||
}
|
||||
auth, err := (&signableRequest{
|
||||
Method: req.Method,
|
||||
URI: reqURL.RequestURI(),
|
||||
Origin: c.ServerName,
|
||||
Destination: params.ServerName,
|
||||
Content: reqJSON,
|
||||
Content: contentAny,
|
||||
}).Sign(c.Key)
|
||||
if err != nil {
|
||||
return nil, mautrix.HTTPError{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue