fix Log attempts to output resp.Body

This commit is contained in:
qulifeng 2021-09-06 23:01:03 +08:00
parent eb729620c5
commit 054271445e
2 changed files with 2 additions and 2 deletions

View File

@ -203,7 +203,7 @@ func ReadURL(url string, client *http.Client, header *http.Header) (body []byte,
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
klog.V(2).Infof("body of failing http response: %v", resp.Body)
klog.V(2).InfoS("Failed to read URL", "statusCode", resp.StatusCode, "URL", url)
return nil, &HTTPError{
StatusCode: resp.StatusCode,
URL: url,

View File

@ -60,7 +60,7 @@ func ReadURL(url string, client *http.Client, header *http.Header) (body []byte,
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
klog.V(2).Infof("body of failing http response: %v", resp.Body)
klog.V(2).InfoS("Failed to read URL", "statusCode", resp.StatusCode, "URL", url)
return nil, &HTTPError{
StatusCode: resp.StatusCode,
URL: url,