Merge pull request #3022 from xiang90/aut_type

etcdhttp: fix the response type for auth
release-2.1
Xiang Li 2015-06-21 15:06:35 -07:00
commit 3e4479b0cd
1 changed files with 2 additions and 2 deletions

View File

@ -185,10 +185,10 @@ func (sh *authHandler) forRole(w http.ResponseWriter, r *http.Request, role stri
return
}
w.Header().Set("X-Etcd-Cluster-ID", sh.cluster.ID().String())
w.Header().Set("Content-Type", "application/json")
switch r.Method {
case "GET":
w.Header().Set("Content-Type", "application/json")
data, err := sh.sec.GetRole(role)
if err != nil {
writeError(w, err)
@ -290,10 +290,10 @@ func (sh *authHandler) forUser(w http.ResponseWriter, r *http.Request, user stri
return
}
w.Header().Set("X-Etcd-Cluster-ID", sh.cluster.ID().String())
w.Header().Set("Content-Type", "application/json")
switch r.Method {
case "GET":
w.Header().Set("Content-Type", "application/json")
u, err := sh.sec.GetUser(user)
if err != nil {
writeError(w, err)