|
|
|
@ -169,25 +169,6 @@ func (api objectAPIHandlers) SelectObjectContentHandler(w http.ResponseWriter, r |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
s3Select, err := s3select.NewS3Select(r.Body) |
|
|
|
|
if err != nil { |
|
|
|
|
if serr, ok := err.(s3select.SelectError); ok { |
|
|
|
|
encodedErrorResponse := encodeResponse(APIErrorResponse{ |
|
|
|
|
Code: serr.ErrorCode(), |
|
|
|
|
Message: serr.ErrorMessage(), |
|
|
|
|
BucketName: bucket, |
|
|
|
|
Key: object, |
|
|
|
|
Resource: r.URL.Path, |
|
|
|
|
RequestID: w.Header().Get(xhttp.AmzRequestID), |
|
|
|
|
HostID: globalDeploymentID, |
|
|
|
|
}) |
|
|
|
|
writeResponse(w, serr.HTTPStatusCode(), encodedErrorResponse, mimeXML) |
|
|
|
|
} else { |
|
|
|
|
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r)) |
|
|
|
|
} |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getObjectNInfo := objectAPI.GetObjectNInfo |
|
|
|
|
if api.CacheAPI() != nil { |
|
|
|
|
getObjectNInfo = api.CacheAPI().GetObjectNInfo |
|
|
|
@ -211,6 +192,26 @@ func (api objectAPIHandlers) SelectObjectContentHandler(w http.ResponseWriter, r |
|
|
|
|
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r)) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
s3Select, err := s3select.NewS3Select(r.Body) |
|
|
|
|
if err != nil { |
|
|
|
|
if serr, ok := err.(s3select.SelectError); ok { |
|
|
|
|
encodedErrorResponse := encodeResponse(APIErrorResponse{ |
|
|
|
|
Code: serr.ErrorCode(), |
|
|
|
|
Message: serr.ErrorMessage(), |
|
|
|
|
BucketName: bucket, |
|
|
|
|
Key: object, |
|
|
|
|
Resource: r.URL.Path, |
|
|
|
|
RequestID: w.Header().Get(xhttp.AmzRequestID), |
|
|
|
|
HostID: globalDeploymentID, |
|
|
|
|
}) |
|
|
|
|
writeResponse(w, serr.HTTPStatusCode(), encodedErrorResponse, mimeXML) |
|
|
|
|
} else { |
|
|
|
|
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r)) |
|
|
|
|
} |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getRetPerms := checkRequestAuthType(ctx, r, policy.GetObjectRetentionAction, bucket, object) |
|
|
|
|
legalHoldPerms := checkRequestAuthType(ctx, r, policy.GetObjectLegalHoldAction, bucket, object) |
|
|
|
|
|
|
|
|
|