Skip to content

Commit

Permalink
Merge pull request etcd-io#2522 from xiang90/user_pw
Browse files Browse the repository at this point in the history
etcdserver/etcdhttp: do not return back the password of a user
  • Loading branch information
xiang90 committed Mar 30, 2015
2 parents 80d08ca + 9d28f94 commit 253f7c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions etcdserver/etcdhttp/client_security.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,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)
Expand All @@ -289,6 +290,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 {
Expand Down

0 comments on commit 253f7c4

Please sign in to comment.