|
@@ -47,6 +47,11 @@ func CurlGet(ctx context.Context, url string, timeout time.Duration) ([]byte, er
|
|
|
}
|
|
|
defer resp.Body.Close()
|
|
|
|
|
|
+ b, err = io.ReadAll(resp.Body)
|
|
|
+ if err != nil {
|
|
|
+ return b, err
|
|
|
+ }
|
|
|
+
|
|
|
if resp.StatusCode != http.StatusOK {
|
|
|
return b, error(&CurlGetStatusError{
|
|
|
Expected: http.StatusOK,
|
|
@@ -54,10 +59,5 @@ func CurlGet(ctx context.Context, url string, timeout time.Duration) ([]byte, er
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- b, err = io.ReadAll(resp.Body)
|
|
|
- if err != nil {
|
|
|
- return b, err
|
|
|
- }
|
|
|
-
|
|
|
return b, nil
|
|
|
}
|