mirror of
https://github.com/pgsty/minio.git
synced 2026-08-02 08:35:58 +03:00
Fix validation in PutBucketNotification handler (#4841)
Fixes #4813 If a TopicConfiguration element or CloudFunction element is found in configuration submitted to PutBucketNotification API, an BadRequest error is returned.
This commit is contained in:
committed by
Dee Koder
parent
3a73c675a6
commit
77d2870f5b
@@ -235,6 +235,12 @@ func checkDuplicateQueueConfigs(configs []queueConfig) APIErrorCode {
|
||||
// if one of the config is malformed or has invalid data it is rejected.
|
||||
// Configuration is never applied partially.
|
||||
func validateNotificationConfig(nConfig notificationConfig) APIErrorCode {
|
||||
// Minio server does not support lambda/topic configurations
|
||||
// currently. Such configuration is rejected.
|
||||
if len(nConfig.LambdaConfigs) > 0 || len(nConfig.TopicConfigs) > 0 {
|
||||
return ErrUnsupportedNotification
|
||||
}
|
||||
|
||||
// Validate all queue configs.
|
||||
if s3Error := validateQueueConfigs(nConfig.QueueConfigs); s3Error != ErrNone {
|
||||
return s3Error
|
||||
|
||||
Reference in New Issue
Block a user