silence gosec warning G107
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
This commit is contained in:
parent
4ccffccc70
commit
9960261c17
|
@ -243,11 +243,16 @@ type httpget func(url string) (int, string, io.ReadCloser, error)
|
||||||
|
|
||||||
// httpgetImpl Implements a function to retrieve a url and return the results.
|
// httpgetImpl Implements a function to retrieve a url and return the results.
|
||||||
func httpgetImpl(url string) (int, string, io.ReadCloser, error) {
|
func httpgetImpl(url string) (int, string, io.ReadCloser, error) {
|
||||||
// nolint:gosec
|
req, err := http.NewRequest(http.MethodGet, url, nil)
|
||||||
resp, err := http.Get(url)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, "", nil, err
|
return 0, "", nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resp, err := http.DefaultClient.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
return 0, "", nil, err
|
||||||
|
}
|
||||||
|
|
||||||
return resp.StatusCode, resp.Status, resp.Body, nil
|
return resp.StatusCode, resp.Status, resp.Body, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue