diff options
author | 2023-08-08 12:45:29 +0100 | |
---|---|---|
committer | 2023-08-08 12:45:29 +0100 | |
commit | 0ddc2edf199c146947423311e68fe109b95388bb (patch) | |
tree | 021104cabd71d975fd6b878502bc81bb3423cd20 /internal/httpclient/client.go | |
parent | [bugfix] don't accept unrelated statuses (#2078) (diff) | |
download | gotosocial-0ddc2edf199c146947423311e68fe109b95388bb.tar.xz |
[bugfix] only set content-length AFTER rewinding body bytes (#2086)
Diffstat (limited to 'internal/httpclient/client.go')
-rw-r--r-- | internal/httpclient/client.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/httpclient/client.go b/internal/httpclient/client.go index ffaf76537..fd70cca7e 100644 --- a/internal/httpclient/client.go +++ b/internal/httpclient/client.go @@ -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. |