mirror of
https://github.com/goharbor/harbor
synced 2025-04-20 16:28:56 +00:00
Merge pull request #1962 from ywk253100/170407_adminserver_log_leak
Fix logs leak
This commit is contained in:
commit
49377c5bc8
|
@ -62,7 +62,7 @@ func (c *cfgStore) Read() (map[string]interface{}, error) {
|
||||||
|
|
||||||
str, ok := v.(string)
|
str, ok := v.(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
log.Warningf("%v is not string, skip decrypt", v)
|
log.Warningf("the value of %s is not string, skip decrypt", key)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httputil"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/vmware/harbor/src/common/api"
|
"github.com/vmware/harbor/src/common/api"
|
||||||
|
@ -203,9 +202,13 @@ func getRepoList(projectID int64) ([]string, error) {
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
dump, _ := httputil.DumpResponse(resp, true)
|
b, err := ioutil.ReadAll(resp.Body)
|
||||||
log.Debugf("response: %q", dump)
|
if err != nil {
|
||||||
return repositories, fmt.Errorf("Unexpected status code when getting repository list: %d", resp.StatusCode)
|
return repositories, err
|
||||||
|
}
|
||||||
|
return repositories,
|
||||||
|
fmt.Errorf("failed to get repo list, response code: %d, error: %s",
|
||||||
|
resp.StatusCode, string(b))
|
||||||
}
|
}
|
||||||
|
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user