Merge branch 'dev' into 'main'

This commit is contained in:
stSolo
2022-08-18 10:57:29 +03:00
parent db4b8a4e9e
commit 96ce997ecc
4 changed files with 73 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ package client
import (
"fmt"
"io/ioutil"
"io"
"net/http"
"strings"
"time"
@@ -31,7 +31,7 @@ func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) {
return nil, fmt.Errorf("cannot get token: %v", err)
}
tokenBytes, _ := ioutil.ReadAll(resp.Body)
tokenBytes, _ := io.ReadAll(resp.Body)
resp.Body.Close()
if resp.StatusCode != 200 {
@@ -56,7 +56,7 @@ func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) {
if resp.StatusCode == 200 {
return resp, nil
}
respBytes, _ := ioutil.ReadAll(resp.Body)
respBytes, _ := io.ReadAll(resp.Body)
err = fmt.Errorf("%s", respBytes)
resp.Body.Close()
}