httpclient: allow to set custom headers

This commit is contained in:
Nicola Murino
2021-05-25 08:36:01 +02:00
parent 1223957f91
commit 600268ebb8
12 changed files with 204 additions and 47 deletions

View File

@@ -404,7 +404,7 @@ func createDirPathIfMissing(file string, perm os.FileMode) error {
func GenerateRandomBytes(length int) []byte {
b := make([]byte, length)
_, err := io.ReadFull(rand.Reader, b)
if err != nil {
if err == nil {
return b
}