mirror of https://github.com/status-im/consul.git
agent: avoid masking errors when ACLs deny a request
This commit is contained in:
parent
beb27fb3ef
commit
5bde81bcdc
|
@ -62,9 +62,13 @@ func (s *HTTPServer) EventFire(resp http.ResponseWriter, req *http.Request) (int
|
||||||
|
|
||||||
// Try to fire the event
|
// Try to fire the event
|
||||||
if err := s.agent.UserEvent(dc, token, event); err != nil {
|
if err := s.agent.UserEvent(dc, token, event); err != nil {
|
||||||
resp.WriteHeader(403)
|
if strings.Contains(err.Error(), permissionDenied) {
|
||||||
resp.Write([]byte(permissionDenied))
|
resp.WriteHeader(403)
|
||||||
return nil, nil
|
resp.Write([]byte(permissionDenied))
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
resp.WriteHeader(500)
|
||||||
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the event
|
// Return the event
|
||||||
|
|
Loading…
Reference in New Issue