mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2024-12-28 17:24:41 +01:00
[bugfix] only set content-length AFTER rewinding body bytes (#2086)
This commit is contained in:
parent
3920bc87d1
commit
0ddc2edf19
@ -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 New Issue
Block a user