Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Z-Bolt/OctoScreen.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShannon Wynter <github.com.alias@fremnet.net>2021-06-23 12:36:10 +0300
committerShannon Wynter <github.com.alias@fremnet.net>2021-06-23 12:36:10 +0300
commitc5924611dd2a7e5166e37a63a3b22a53c43b77bb (patch)
treeefb30fabeefe9c9e559034bcc64876676036e54f
parentb073bbe99cc027589c35750aa6660ea511a02894 (diff)
Drain request body before closing
-rwxr-xr-xoctoprintApis/client.go5
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 {