mirror of https://github.com/minio/minio.git
SetConfigHandler should avoid setting an invalid notification config (#6679)
Fixes #6642 Fixes #6641
This commit is contained in:
parent
06ef8248c3
commit
acf46cc3b5
|
@ -1114,6 +1114,11 @@ func (a adminAPIHandlers) SetConfigHandler(w http.ResponseWriter, r *http.Reques
|
|||
return
|
||||
}
|
||||
|
||||
if err = config.TestNotificationTargets(); err != nil {
|
||||
writeCustomErrorResponseJSON(w, ErrAdminConfigBadJSON, err.Error(), r.URL)
|
||||
return
|
||||
}
|
||||
|
||||
if err = saveServerConfig(ctx, objectAPI, &config); err != nil {
|
||||
writeErrorResponseJSON(w, toAdminAPIErrCode(err), r.URL)
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue