fix: properly send group unset policy (#12694)

In distributed setups `mc admin group unset`
was not correctly working due to incorrect
handling of query parameters between peers.
This commit is contained in:
Harshavardhana 2021-07-13 09:32:35 -07:00 committed by GitHub
parent e25ae1c01f
commit 559d075627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,8 +129,8 @@ func (s *peerRESTServer) LoadPolicyMappingHandler(w http.ResponseWriter, r *http
s.writeErrorResponse(w, errors.New("user-or-group is missing"))
return
}
_, isGroup := vars[peerRESTIsGroup]
_, isGroup := r.URL.Query()[peerRESTIsGroup]
if err := globalIAMSys.LoadPolicyMapping(objAPI, userOrGroup, isGroup); err != nil {
s.writeErrorResponse(w, err)
return
@ -384,7 +384,6 @@ func (s *peerRESTServer) NetInfoHandler(w http.ResponseWriter, r *http.Request)
}
if n != r.ContentLength {
err := fmt.Errorf("Subnet health: short read: expected %d found %d", r.ContentLength, n)
logger.LogIf(ctx, err)
w.Header().Set("FinalStatus", err.Error())
return