mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-10-31 22:40:01 +00:00
close + drain body if response body is too large (#2897)
This commit is contained in:
parent
6171dcbe51
commit
d3f6960ba0
1 changed files with 1 additions and 0 deletions
|
@ -400,6 +400,7 @@ func (c *Client) do(r *Request) (rsp *http.Response, retry bool, err error) {
|
||||||
|
|
||||||
// Check response body not too large.
|
// Check response body not too large.
|
||||||
if rsp.ContentLength > c.bodyMax {
|
if rsp.ContentLength > c.bodyMax {
|
||||||
|
_ = rsp.Body.Close()
|
||||||
return nil, false, ErrBodyTooLarge
|
return nil, false, ErrBodyTooLarge
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue