@ -228,6 +228,7 @@ func (api objectAPIHandlers) ListenBucketNotificationHandler(w http.ResponseWrit
bucketName := vars [ "bucket" ]
bucketName := vars [ "bucket" ]
values := r . URL . Query ( )
values := r . URL . Query ( )
values . Set ( peerRESTListenBucket , bucketName )
var prefix string
var prefix string
if len ( values [ peerRESTListenPrefix ] ) > 1 {
if len ( values [ peerRESTListenPrefix ] ) > 1 {
@ -295,6 +296,9 @@ func (api objectAPIHandlers) ListenBucketNotificationHandler(w http.ResponseWrit
if ! ok {
if ! ok {
return false
return false
}
}
if ev . S3 . Bucket . Name != values . Get ( peerRESTListenBucket ) {
return false
}
objectName , uerr := url . QueryUnescape ( ev . S3 . Object . Key )
objectName , uerr := url . QueryUnescape ( ev . S3 . Object . Key )
if uerr != nil {
if uerr != nil {
objectName = ev . S3 . Object . Key
objectName = ev . S3 . Object . Key
@ -306,7 +310,7 @@ func (api objectAPIHandlers) ListenBucketNotificationHandler(w http.ResponseWrit
if peer == nil {
if peer == nil {
continue
continue
}
}
peer . Listen ( listenCh , doneCh , r . URL . Query ( ) )
peer . Listen ( listenCh , doneCh , values )
}
}
keepAliveTicker := time . NewTicker ( 500 * time . Millisecond )
keepAliveTicker := time . NewTicker ( 500 * time . Millisecond )