mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Use io.ReadAll instead of json.Decode (#56528)
This commit is contained in:
committed by
GitHub
parent
eef3f28447
commit
df2abf09c2
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -224,8 +225,8 @@ func getSHA256(u string) ([]byte, error) {
|
||||
return nil, fmt.Errorf("failed downloading %s: %s", u, resp.Status)
|
||||
}
|
||||
|
||||
var sha256 []byte
|
||||
if err := json.NewDecoder(resp.Body).Decode(&sha256); err != nil {
|
||||
sha256, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return sha256, nil
|
||||
|
||||
Reference in New Issue
Block a user