fix: should return when error happend (#19342)

This commit is contained in:
jiuker 2024-03-26 22:51:56 +08:00 committed by GitHub
parent deeadd1a37
commit 4b9192034c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -193,6 +193,7 @@ func (a adminAPIHandlers) AddServiceAccountLDAP(w http.ResponseWriter, r *http.R
// fail if ldap is not enabled
if !globalIAMSys.LDAPConfig.Enabled() {
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, errors.New("LDAP not enabled")), r.URL)
return
}
// Find the user for the request sender (as it may be sent via a service