mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver/etcdhttp: do not return back the password of a user
This commit is contained in:
parent
8a589d11d5
commit
9d28f94005
@ -266,6 +266,7 @@ func (sh *securityHandler) forUser(w http.ResponseWriter, r *http.Request, user
|
||||
return
|
||||
}
|
||||
u.Password = ""
|
||||
|
||||
err = json.NewEncoder(w).Encode(u)
|
||||
if err != nil {
|
||||
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)
|
||||
return
|
||||
}
|
||||
newuser.Password = ""
|
||||
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
err = json.NewEncoder(w).Encode(newuser)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user