@ -78,6 +78,8 @@ func setHeadGetRespHeaders(w http.ResponseWriter, reqParams url.Values) {
func ( api objectAPIHandlers ) SelectObjectContentHandler ( w http . ResponseWriter , r * http . Request ) {
ctx := newContext ( r , w , "SelectObject" )
defer logger . AuditLog ( ctx , r )
// Fetch object stat info.
objectAPI := api . ObjectAPI ( )
if objectAPI == nil {
@ -273,6 +275,12 @@ func (api objectAPIHandlers) SelectObjectContentHandler(w http.ResponseWriter, r
logger . LogIf ( ctx , err )
}
}
for k , v := range objInfo . UserDefined {
logger . GetReqInfo ( ctx ) . SetTags ( k , v )
}
logger . GetReqInfo ( ctx ) . SetTags ( "etag" , objInfo . ETag )
}
// GetObjectHandler - GET Object
@ -282,6 +290,8 @@ func (api objectAPIHandlers) SelectObjectContentHandler(w http.ResponseWriter, r
func ( api objectAPIHandlers ) GetObjectHandler ( w http . ResponseWriter , r * http . Request ) {
ctx := newContext ( r , w , "GetObject" )
defer logger . AuditLog ( ctx , r )
objectAPI := api . ObjectAPI ( )
if objectAPI == nil {
writeErrorResponse ( w , ErrServerNotInitialized , r . URL )
@ -437,6 +447,12 @@ func (api objectAPIHandlers) GetObjectHandler(w http.ResponseWriter, r *http.Req
Host : host ,
Port : port ,
} )
for k , v := range objInfo . UserDefined {
logger . GetReqInfo ( ctx ) . SetTags ( k , v )
}
logger . GetReqInfo ( ctx ) . SetTags ( "etag" , objInfo . ETag )
}
// HeadObjectHandler - HEAD Object
@ -445,6 +461,8 @@ func (api objectAPIHandlers) GetObjectHandler(w http.ResponseWriter, r *http.Req
func ( api objectAPIHandlers ) HeadObjectHandler ( w http . ResponseWriter , r * http . Request ) {
ctx := newContext ( r , w , "HeadObject" )
defer logger . AuditLog ( ctx , r )
objectAPI := api . ObjectAPI ( )
if objectAPI == nil {
writeErrorResponseHeadersOnly ( w , ErrServerNotInitialized )
@ -578,6 +596,12 @@ func (api objectAPIHandlers) HeadObjectHandler(w http.ResponseWriter, r *http.Re
Host : host ,
Port : port ,
} )
for k , v := range objInfo . UserDefined {
logger . GetReqInfo ( ctx ) . SetTags ( k , v )
}
logger . GetReqInfo ( ctx ) . SetTags ( "etag" , objInfo . ETag )
}
// Extract metadata relevant for an CopyObject operation based on conditional
@ -618,6 +642,8 @@ func getCpObjMetadataFromHeader(ctx context.Context, r *http.Request, userMeta m
func ( api objectAPIHandlers ) CopyObjectHandler ( w http . ResponseWriter , r * http . Request ) {
ctx := newContext ( r , w , "CopyObject" )
defer logger . AuditLog ( ctx , r )
objectAPI := api . ObjectAPI ( )
if objectAPI == nil {
writeErrorResponse ( w , ErrServerNotInitialized , r . URL )
@ -951,6 +977,12 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re
Host : host ,
Port : port ,
} )
for k , v := range objInfo . UserDefined {
logger . GetReqInfo ( ctx ) . SetTags ( k , v )
}
logger . GetReqInfo ( ctx ) . SetTags ( "etag" , objInfo . ETag )
}
// PutObjectHandler - PUT Object
@ -964,6 +996,8 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re
func ( api objectAPIHandlers ) PutObjectHandler ( w http . ResponseWriter , r * http . Request ) {
ctx := newContext ( r , w , "PutObject" )
defer logger . AuditLog ( ctx , r )
objectAPI := api . ObjectAPI ( )
if objectAPI == nil {
writeErrorResponse ( w , ErrServerNotInitialized , r . URL )
@ -1203,6 +1237,12 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req
Host : host ,
Port : port ,
} )
for k , v := range objInfo . UserDefined {
logger . GetReqInfo ( ctx ) . SetTags ( k , v )
}
logger . GetReqInfo ( ctx ) . SetTags ( "etag" , objInfo . ETag )
}
/// Multipart objectAPIHandlers
@ -1216,6 +1256,8 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req
func ( api objectAPIHandlers ) NewMultipartUploadHandler ( w http . ResponseWriter , r * http . Request ) {
ctx := newContext ( r , w , "NewMultipartUpload" )
defer logger . AuditLog ( ctx , r )
objectAPI := api . ObjectAPI ( )
if objectAPI == nil {
writeErrorResponse ( w , ErrServerNotInitialized , r . URL )
@ -1308,6 +1350,8 @@ func (api objectAPIHandlers) NewMultipartUploadHandler(w http.ResponseWriter, r
func ( api objectAPIHandlers ) CopyObjectPartHandler ( w http . ResponseWriter , r * http . Request ) {
ctx := newContext ( r , w , "CopyObjectPart" )
defer logger . AuditLog ( ctx , r )
objectAPI := api . ObjectAPI ( )
if objectAPI == nil {
writeErrorResponse ( w , ErrServerNotInitialized , r . URL )
@ -1530,6 +1574,8 @@ func (api objectAPIHandlers) CopyObjectPartHandler(w http.ResponseWriter, r *htt
func ( api objectAPIHandlers ) PutObjectPartHandler ( w http . ResponseWriter , r * http . Request ) {
ctx := newContext ( r , w , "PutObjectPart" )
defer logger . AuditLog ( ctx , r )
objectAPI := api . ObjectAPI ( )
if objectAPI == nil {
writeErrorResponse ( w , ErrServerNotInitialized , r . URL )
@ -1770,6 +1816,8 @@ func (api objectAPIHandlers) PutObjectPartHandler(w http.ResponseWriter, r *http
func ( api objectAPIHandlers ) AbortMultipartUploadHandler ( w http . ResponseWriter , r * http . Request ) {
ctx := newContext ( r , w , "AbortMultipartUpload" )
defer logger . AuditLog ( ctx , r )
vars := mux . Vars ( r )
bucket := vars [ "bucket" ]
object := vars [ "object" ]
@ -1809,6 +1857,8 @@ func (api objectAPIHandlers) AbortMultipartUploadHandler(w http.ResponseWriter,
func ( api objectAPIHandlers ) ListObjectPartsHandler ( w http . ResponseWriter , r * http . Request ) {
ctx := newContext ( r , w , "ListObjectParts" )
defer logger . AuditLog ( ctx , r )
vars := mux . Vars ( r )
bucket := vars [ "bucket" ]
object := vars [ "object" ]
@ -1849,6 +1899,8 @@ func (api objectAPIHandlers) ListObjectPartsHandler(w http.ResponseWriter, r *ht
func ( api objectAPIHandlers ) CompleteMultipartUploadHandler ( w http . ResponseWriter , r * http . Request ) {
ctx := newContext ( r , w , "CompleteMultipartUpload" )
defer logger . AuditLog ( ctx , r )
vars := mux . Vars ( r )
bucket := vars [ "bucket" ]
object := vars [ "object" ]
@ -1955,6 +2007,12 @@ func (api objectAPIHandlers) CompleteMultipartUploadHandler(w http.ResponseWrite
Host : host ,
Port : port ,
} )
for k , v := range objInfo . UserDefined {
logger . GetReqInfo ( ctx ) . SetTags ( k , v )
}
logger . GetReqInfo ( ctx ) . SetTags ( "etag" , objInfo . ETag )
}
/// Delete objectAPIHandlers
@ -1963,6 +2021,8 @@ func (api objectAPIHandlers) CompleteMultipartUploadHandler(w http.ResponseWrite
func ( api objectAPIHandlers ) DeleteObjectHandler ( w http . ResponseWriter , r * http . Request ) {
ctx := newContext ( r , w , "DeleteObject" )
defer logger . AuditLog ( ctx , r )
vars := mux . Vars ( r )
bucket := vars [ "bucket" ]
object := vars [ "object" ]