diff options
author | JeffB42 <10328858+JeffB42@users.noreply.github.com> | 2021-07-17 07:05:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-17 07:05:48 +0300 |
commit | 2ba024b57ba27e71ea2998b4157daa5961fc7afb (patch) | |
tree | efb30fabeefe9c9e559034bcc64876676036e54f | |
parent | b073bbe99cc027589c35750aa6660ea511a02894 (diff) | |
parent | c5924611dd2a7e5166e37a63a3b22a53c43b77bb (diff) |
Merge pull request #306 from freman/drainbody
Drain request body before closing
-rwxr-xr-x | octoprintApis/client.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/octoprintApis/client.go b/octoprintApis/client.go index de7d596..6da7f1a 100755 --- a/octoprintApis/client.go +++ b/octoprintApis/client.go @@ -140,7 +140,10 @@ func (this *Client) handleResponse( ) ([]byte, error) { logger.TraceEnter("Client.handleResponse()") - defer httpResponse.Body.Close() + defer func() { + io.Copy(ioutil.Discard, httpResponse.Body) + httpResponse.Body.Close() + }() if statusMapping != nil { if err := statusMapping.Error(httpResponse.StatusCode); err != nil { |