mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
if the response is empty, return an empty string
Signed-off-by: David Wertenteil <dwertent@armosec.io>
This commit is contained in:
@@ -67,6 +67,12 @@ func errAuth(resp *http.Response) error {
|
||||
}
|
||||
|
||||
func readString(rdr io.Reader, sizeHint int64) (string, error) {
|
||||
|
||||
// if the response is empty, return an empty string
|
||||
if sizeHint < 0 {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
var b strings.Builder
|
||||
|
||||
b.Grow(int(sizeHint))
|
||||
|
||||
Reference in New Issue
Block a user