etcdserver/etcdhttp: do not return back the password of a user
parent
8a589d11d5
commit
9d28f94005
|
@ -266,6 +266,7 @@ func (sh *securityHandler) forUser(w http.ResponseWriter, r *http.Request, user
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
u.Password = ""
|
u.Password = ""
|
||||||
|
|
||||||
err = json.NewEncoder(w).Encode(u)
|
err = json.NewEncoder(w).Encode(u)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("etcdhttp: forUser error encoding on", r.URL)
|
log.Println("etcdhttp: forUser error encoding on", r.URL)
|
||||||
|
@ -288,6 +289,8 @@ func (sh *securityHandler) forUser(w http.ResponseWriter, r *http.Request, user
|
||||||
writeError(w, err)
|
writeError(w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
newuser.Password = ""
|
||||||
|
|
||||||
w.WriteHeader(http.StatusCreated)
|
w.WriteHeader(http.StatusCreated)
|
||||||
err = json.NewEncoder(w).Encode(newuser)
|
err = json.NewEncoder(w).Encode(newuser)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue