|
|
@ -24,7 +24,6 @@ import ( |
|
|
|
"encoding/xml" |
|
|
|
"encoding/xml" |
|
|
|
"io" |
|
|
|
"io" |
|
|
|
goioutil "io/ioutil" |
|
|
|
goioutil "io/ioutil" |
|
|
|
"net" |
|
|
|
|
|
|
|
"net/http" |
|
|
|
"net/http" |
|
|
|
"net/url" |
|
|
|
"net/url" |
|
|
|
"sort" |
|
|
|
"sort" |
|
|
@ -221,12 +220,6 @@ func (api objectAPIHandlers) SelectObjectContentHandler(w http.ResponseWriter, r |
|
|
|
s3Select.Evaluate(w) |
|
|
|
s3Select.Evaluate(w) |
|
|
|
s3Select.Close() |
|
|
|
s3Select.Close() |
|
|
|
|
|
|
|
|
|
|
|
// Get host and port from Request.RemoteAddr.
|
|
|
|
|
|
|
|
host, port, err := net.SplitHostPort(handlers.GetSourceIP(r)) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
host, port = "", "" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Notify object accessed via a GET request.
|
|
|
|
// Notify object accessed via a GET request.
|
|
|
|
sendEvent(eventArgs{ |
|
|
|
sendEvent(eventArgs{ |
|
|
|
EventName: event.ObjectAccessedGet, |
|
|
|
EventName: event.ObjectAccessedGet, |
|
|
@ -235,8 +228,7 @@ func (api objectAPIHandlers) SelectObjectContentHandler(w http.ResponseWriter, r |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
Host: host, |
|
|
|
Host: handlers.GetSourceIP(r), |
|
|
|
Port: port, |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -402,12 +394,6 @@ func (api objectAPIHandlers) GetObjectHandler(w http.ResponseWriter, r *http.Req |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Get host and port from Request.RemoteAddr.
|
|
|
|
|
|
|
|
host, port, err := net.SplitHostPort(handlers.GetSourceIP(r)) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
host, port = "", "" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Notify object accessed via a GET request.
|
|
|
|
// Notify object accessed via a GET request.
|
|
|
|
sendEvent(eventArgs{ |
|
|
|
sendEvent(eventArgs{ |
|
|
|
EventName: event.ObjectAccessedGet, |
|
|
|
EventName: event.ObjectAccessedGet, |
|
|
@ -416,8 +402,7 @@ func (api objectAPIHandlers) GetObjectHandler(w http.ResponseWriter, r *http.Req |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
Host: host, |
|
|
|
Host: handlers.GetSourceIP(r), |
|
|
|
Port: port, |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -562,11 +547,6 @@ func (api objectAPIHandlers) HeadObjectHandler(w http.ResponseWriter, r *http.Re |
|
|
|
w.WriteHeader(http.StatusOK) |
|
|
|
w.WriteHeader(http.StatusOK) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Get host and port from Request.RemoteAddr.
|
|
|
|
|
|
|
|
host, port, err := net.SplitHostPort(handlers.GetSourceIP(r)) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
host, port = "", "" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Notify object accessed via a HEAD request.
|
|
|
|
// Notify object accessed via a HEAD request.
|
|
|
|
sendEvent(eventArgs{ |
|
|
|
sendEvent(eventArgs{ |
|
|
|
EventName: event.ObjectAccessedHead, |
|
|
|
EventName: event.ObjectAccessedHead, |
|
|
@ -575,8 +555,7 @@ func (api objectAPIHandlers) HeadObjectHandler(w http.ResponseWriter, r *http.Re |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
Host: host, |
|
|
|
Host: handlers.GetSourceIP(r), |
|
|
|
Port: port, |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1032,12 +1011,6 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re |
|
|
|
// Write success response.
|
|
|
|
// Write success response.
|
|
|
|
writeSuccessResponseXML(w, encodedSuccessResponse) |
|
|
|
writeSuccessResponseXML(w, encodedSuccessResponse) |
|
|
|
|
|
|
|
|
|
|
|
// Get host and port from Request.RemoteAddr.
|
|
|
|
|
|
|
|
host, port, err := net.SplitHostPort(handlers.GetSourceIP(r)) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
host, port = "", "" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if objInfo.IsCompressed() { |
|
|
|
if objInfo.IsCompressed() { |
|
|
|
objInfo.Size = actualSize |
|
|
|
objInfo.Size = actualSize |
|
|
|
} |
|
|
|
} |
|
|
@ -1050,8 +1023,7 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
Host: host, |
|
|
|
Host: handlers.GetSourceIP(r), |
|
|
|
Port: port, |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1303,12 +1275,6 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req |
|
|
|
|
|
|
|
|
|
|
|
writeSuccessResponseHeadersOnly(w) |
|
|
|
writeSuccessResponseHeadersOnly(w) |
|
|
|
|
|
|
|
|
|
|
|
// Get host and port from Request.RemoteAddr.
|
|
|
|
|
|
|
|
host, port, err := net.SplitHostPort(handlers.GetSourceIP(r)) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
host, port = "", "" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Notify object created event.
|
|
|
|
// Notify object created event.
|
|
|
|
sendEvent(eventArgs{ |
|
|
|
sendEvent(eventArgs{ |
|
|
|
EventName: event.ObjectCreatedPut, |
|
|
|
EventName: event.ObjectCreatedPut, |
|
|
@ -1317,8 +1283,7 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
Host: host, |
|
|
|
Host: handlers.GetSourceIP(r), |
|
|
|
Port: port, |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2345,16 +2310,12 @@ func (api objectAPIHandlers) CompleteMultipartUploadHandler(w http.ResponseWrite |
|
|
|
writeSuccessResponseXML(w, encodedSuccessResponse) |
|
|
|
writeSuccessResponseXML(w, encodedSuccessResponse) |
|
|
|
|
|
|
|
|
|
|
|
// Get host and port from Request.RemoteAddr.
|
|
|
|
// Get host and port from Request.RemoteAddr.
|
|
|
|
host, port, err := net.SplitHostPort(handlers.GetSourceIP(r)) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
host, port = "", "" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if objectAPI.IsEncryptionSupported() { |
|
|
|
if objectAPI.IsEncryptionSupported() { |
|
|
|
if crypto.IsEncrypted(objInfo.UserDefined) { |
|
|
|
if crypto.IsEncrypted(objInfo.UserDefined) { |
|
|
|
objInfo.Size, _ = objInfo.DecryptedSize() |
|
|
|
objInfo.Size, _ = objInfo.DecryptedSize() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Notify object created event.
|
|
|
|
// Notify object created event.
|
|
|
|
sendEvent(eventArgs{ |
|
|
|
sendEvent(eventArgs{ |
|
|
|
EventName: event.ObjectCreatedCompleteMultipartUpload, |
|
|
|
EventName: event.ObjectCreatedCompleteMultipartUpload, |
|
|
@ -2363,8 +2324,7 @@ func (api objectAPIHandlers) CompleteMultipartUploadHandler(w http.ResponseWrite |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
Host: host, |
|
|
|
Host: handlers.GetSourceIP(r), |
|
|
|
Port: port, |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|