diff options
| author | 2024-05-05 15:43:38 +0000 | |
|---|---|---|
| committer | 2024-05-05 16:43:38 +0100 | |
| commit | d3f6960ba074bff5963c40fb6ff95cfe316d542b (patch) | |
| tree | f516a5603eba71a3f5c51f3fd68ea6f5e04feed1 /internal | |
| parent | [feature] Add HTTP header permission section to frontend (#2893) (diff) | |
| download | gotosocial-d3f6960ba074bff5963c40fb6ff95cfe316d542b.tar.xz | |
close + drain body if response body is too large (#2897)
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/httpclient/client.go | 1 | 
1 files changed, 1 insertions, 0 deletions
| diff --git a/internal/httpclient/client.go b/internal/httpclient/client.go index 74c931ea9..ba8760091 100644 --- a/internal/httpclient/client.go +++ b/internal/httpclient/client.go @@ -400,6 +400,7 @@ func (c *Client) do(r *Request) (rsp *http.Response, retry bool, err error) {  	// Check response body not too large.  	if rsp.ContentLength > c.bodyMax { +		_ = rsp.Body.Close()  		return nil, false, ErrBodyTooLarge  	} | 
