Skip to content

Commit

Permalink
fix(api_default): fix superfluous headers 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Souheil-Yazji authored Nov 28, 2024
1 parent 2d4f16a commit ed6c5cc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions components/access-management/kfam/api_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,7 @@ func (c *KfamV1Alpha1Client) ReadBinding(w http.ResponseWriter, r *http.Request)
return
}
IncRequestCounter("", "", action, r.URL.Path)
if writeResponse(w, result) {
w.WriteHeader(http.StatusOK)
} else {
if !writeResponse(w, result) {
w.WriteHeader(http.StatusInternalServerError)
}
}
Expand All @@ -309,7 +307,6 @@ func (c *KfamV1Alpha1Client) QueryClusterAdmin(w http.ResponseWriter, r *http.Re
queryUser := queries.Get("user")
if writeResponse(w, []byte(strconv.FormatBool(c.isClusterAdmin(queryUser)))) {
IncRequestCounter("", "", action, r.URL.Path)
w.WriteHeader(http.StatusOK)
} else {
IncRequestErrorCounter(err.Error(), "", action, r.URL.Path,
SEVERITY_MAJOR)
Expand Down

0 comments on commit ed6c5cc

Please sign in to comment.