mirror of
https://codeberg.org/superseriousbusiness/gotosocial.git
synced 2024-12-18 07:01:49 +03: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.
|
// Rewind body reader and content-length if set.
|
||||||
if rc, ok := r.Body.(*byteutil.ReadNopCloser); ok {
|
if rc, ok := r.Body.(*byteutil.ReadNopCloser); ok {
|
||||||
|
rc.Rewind() // set len AFTER rewind
|
||||||
r.ContentLength = int64(rc.Len())
|
r.ContentLength = int64(rc.Len())
|
||||||
rc.Rewind()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sign the outgoing request.
|
// Sign the outgoing request.
|
||||||
|
|
Loading…
Reference in a new issue