|
|
@ -378,17 +378,15 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re |
|
|
|
// write success response.
|
|
|
|
// write success response.
|
|
|
|
writeSuccessResponse(w, encodedSuccessResponse) |
|
|
|
writeSuccessResponse(w, encodedSuccessResponse) |
|
|
|
|
|
|
|
|
|
|
|
if globalEventNotifier.IsBucketNotificationSet(bucket) { |
|
|
|
// Notify object created event.
|
|
|
|
// Notify object created event.
|
|
|
|
eventNotify(eventData{ |
|
|
|
eventNotify(eventData{ |
|
|
|
Type: ObjectCreatedCopy, |
|
|
|
Type: ObjectCreatedCopy, |
|
|
|
Bucket: bucket, |
|
|
|
Bucket: bucket, |
|
|
|
ObjInfo: objInfo, |
|
|
|
ObjInfo: objInfo, |
|
|
|
ReqParams: map[string]string{ |
|
|
|
ReqParams: map[string]string{ |
|
|
|
"sourceIPAddress": r.RemoteAddr, |
|
|
|
"sourceIPAddress": r.RemoteAddr, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// PutObjectHandler - PUT Object
|
|
|
|
// PutObjectHandler - PUT Object
|
|
|
@ -482,17 +480,15 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req |
|
|
|
w.Header().Set("ETag", "\""+objInfo.MD5Sum+"\"") |
|
|
|
w.Header().Set("ETag", "\""+objInfo.MD5Sum+"\"") |
|
|
|
writeSuccessResponse(w, nil) |
|
|
|
writeSuccessResponse(w, nil) |
|
|
|
|
|
|
|
|
|
|
|
if globalEventNotifier.IsBucketNotificationSet(bucket) { |
|
|
|
// Notify object created event.
|
|
|
|
// Notify object created event.
|
|
|
|
eventNotify(eventData{ |
|
|
|
eventNotify(eventData{ |
|
|
|
Type: ObjectCreatedPut, |
|
|
|
Type: ObjectCreatedPut, |
|
|
|
Bucket: bucket, |
|
|
|
Bucket: bucket, |
|
|
|
ObjInfo: objInfo, |
|
|
|
ObjInfo: objInfo, |
|
|
|
ReqParams: map[string]string{ |
|
|
|
ReqParams: map[string]string{ |
|
|
|
"sourceIPAddress": r.RemoteAddr, |
|
|
|
"sourceIPAddress": r.RemoteAddr, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Multipart objectAPIHandlers
|
|
|
|
/// Multipart objectAPIHandlers
|
|
|
@ -834,24 +830,22 @@ func (api objectAPIHandlers) CompleteMultipartUploadHandler(w http.ResponseWrite |
|
|
|
w.Write(encodedSuccessResponse) |
|
|
|
w.Write(encodedSuccessResponse) |
|
|
|
w.(http.Flusher).Flush() |
|
|
|
w.(http.Flusher).Flush() |
|
|
|
|
|
|
|
|
|
|
|
if globalEventNotifier.IsBucketNotificationSet(bucket) { |
|
|
|
// Fetch object info for notifications.
|
|
|
|
// Fetch object info for notifications.
|
|
|
|
objInfo, err := objectAPI.GetObjectInfo(bucket, object) |
|
|
|
objInfo, err := objectAPI.GetObjectInfo(bucket, object) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
errorIf(err, "Unable to fetch object info for \"%s\"", path.Join(bucket, object)) |
|
|
|
errorIf(err, "Unable to fetch object info for \"%s\"", path.Join(bucket, object)) |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Notify object created event.
|
|
|
|
|
|
|
|
eventNotify(eventData{ |
|
|
|
|
|
|
|
Type: ObjectCreatedCompleteMultipartUpload, |
|
|
|
|
|
|
|
Bucket: bucket, |
|
|
|
|
|
|
|
ObjInfo: objInfo, |
|
|
|
|
|
|
|
ReqParams: map[string]string{ |
|
|
|
|
|
|
|
"sourceIPAddress": r.RemoteAddr, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Notify object created event.
|
|
|
|
|
|
|
|
eventNotify(eventData{ |
|
|
|
|
|
|
|
Type: ObjectCreatedCompleteMultipartUpload, |
|
|
|
|
|
|
|
Bucket: bucket, |
|
|
|
|
|
|
|
ObjInfo: objInfo, |
|
|
|
|
|
|
|
ReqParams: map[string]string{ |
|
|
|
|
|
|
|
"sourceIPAddress": r.RemoteAddr, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Delete objectAPIHandlers
|
|
|
|
/// Delete objectAPIHandlers
|
|
|
@ -895,17 +889,15 @@ func (api objectAPIHandlers) DeleteObjectHandler(w http.ResponseWriter, r *http. |
|
|
|
} |
|
|
|
} |
|
|
|
writeSuccessNoContent(w) |
|
|
|
writeSuccessNoContent(w) |
|
|
|
|
|
|
|
|
|
|
|
if globalEventNotifier.IsBucketNotificationSet(bucket) { |
|
|
|
// Notify object deleted event.
|
|
|
|
// Notify object deleted event.
|
|
|
|
eventNotify(eventData{ |
|
|
|
eventNotify(eventData{ |
|
|
|
Type: ObjectRemovedDelete, |
|
|
|
Type: ObjectRemovedDelete, |
|
|
|
Bucket: bucket, |
|
|
|
Bucket: bucket, |
|
|
|
ObjInfo: ObjectInfo{ |
|
|
|
ObjInfo: ObjectInfo{ |
|
|
|
Name: object, |
|
|
|
Name: object, |
|
|
|
}, |
|
|
|
}, |
|
|
|
ReqParams: map[string]string{ |
|
|
|
ReqParams: map[string]string{ |
|
|
|
"sourceIPAddress": r.RemoteAddr, |
|
|
|
"sourceIPAddress": r.RemoteAddr, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|