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,10 +62,14 @@ func (s *HTTPServer) EventFire(resp http.ResponseWriter, req *http.Request) (int
|
|||
|
||||
// Try to fire the event
|
||||
if err := s.agent.UserEvent(dc, token, event); err != nil {
|
||||
if strings.Contains(err.Error(), permissionDenied) {
|
||||
resp.WriteHeader(403)
|
||||
resp.Write([]byte(permissionDenied))
|
||||
return nil, nil
|
||||
}
|
||||
resp.WriteHeader(500)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Return the event
|
||||
return event, nil
|
||||
|
|
Loading…
Reference in New Issue