summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/SevereCloud/vksdk/v2/api/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/SevereCloud/vksdk/v2/api/api.go')
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/api/api.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/api.go b/vendor/github.com/SevereCloud/vksdk/v2/api/api.go
index 760bc7e0..dfc4afaf 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/api/api.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/api/api.go
@@ -269,9 +269,15 @@ func (vk *VK) DefaultHandler(method string, sliceParams ...Params) (Response, er
switch resp.Header.Get("Content-Encoding") {
case "zstd":
- reader, _ = zstd.NewReader(resp.Body)
+ zstdReader, _ := zstd.NewReader(resp.Body)
+ defer zstdReader.Close()
+
+ reader = zstdReader
case "gzip":
- reader, _ = gzip.NewReader(resp.Body)
+ gzipReader, _ := gzip.NewReader(resp.Body)
+ defer gzipReader.Close()
+
+ reader = gzipReader
default:
reader = resp.Body
}