frontend: fix uninitialized buffer (#41)

This commit is contained in:
Yuhui Xu
2021-09-26 13:26:07 -05:00
committed by GitHub
parent 2166d73b3d
commit 6481e7cc8d
2 changed files with 4 additions and 4 deletions

View File

@@ -55,11 +55,11 @@ func batchRequest(servers []string, endpoint string, command string) []string {
}
buf := make([]byte, 65536)
_, err = io.ReadFull(response.Body, buf)
n, err := io.ReadFull(response.Body, buf)
if err != nil && err != io.ErrUnexpectedEOF {
ch <- channelData{i, err.Error()}
} else {
ch <- channelData{i, string(buf)}
ch <- channelData{i, string(buf[:n])}
}
}(url, i)
}