mirror of
https://github.com/pgsty/minio.git
synced 2026-10-07 18:25:58 +03:00
Fix notification unmarshalling, unmarshal only when size is > 0 (#5087)
Fixes #5085
This commit is contained in:
committed by
Dee Koder
parent
f598f4fd1b
commit
d82a1da511
@@ -63,13 +63,13 @@ func (api objectAPIHandlers) GetBucketNotificationHandler(w http.ResponseWriter,
|
||||
|
||||
// Attempt to successfully load notification config.
|
||||
nConfig, err := loadNotificationConfig(bucket, objAPI)
|
||||
if err != nil && err != errNoSuchNotifications {
|
||||
if err != nil && errorCause(err) != errNoSuchNotifications {
|
||||
errorIf(err, "Unable to read notification configuration.")
|
||||
writeErrorResponse(w, toAPIErrorCode(err), r.URL)
|
||||
return
|
||||
}
|
||||
// For no notifications we write a dummy XML.
|
||||
if err == errNoSuchNotifications {
|
||||
if errorCause(err) == errNoSuchNotifications {
|
||||
// Complies with the s3 behavior in this regard.
|
||||
nConfig = ¬ificationConfig{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user