mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2024-11-23 04:43:13 +00:00
[bugfix] only set content-length AFTER rewinding body bytes (#2086)
This commit is contained in:
parent
3920bc87d1
commit
0ddc2edf19
1 changed files with 1 additions and 1 deletions
|
@ -247,8 +247,8 @@ func (c *Client) DoSigned(r *http.Request, sign SignFunc) (rsp *http.Response, e
|
|||
|
||||
// Rewind body reader and content-length if set.
|
||||
if rc, ok := r.Body.(*byteutil.ReadNopCloser); ok {
|
||||
rc.Rewind() // set len AFTER rewind
|
||||
r.ContentLength = int64(rc.Len())
|
||||
rc.Rewind()
|
||||
}
|
||||
|
||||
// Sign the outgoing request.
|
||||
|
|
Loading…
Reference in a new issue