S3 API: conditional read and write (#7154)
* conditional put * more tests * check all conditions * address comments * conditional multipart complete * conditional reads Read Operations (GET, HEAD): If-None-Match / If-Modified-Since failures → 304 Not Modified ✅ If-Match / If-Unmodified-Since failures → 412 Precondition Failed ✅ Write Operations (PUT, CompleteMultipartUpload): All conditional failures → 412 Precondition Failed ✅ Copy Operations (CopyObject): Copy-source conditionals → 412 Precondition Failed (already implemented) ✅ * test actual code * Interface-Based Testing * cleanup * Testing Interface * Update s3api_object_handlers_put.go * refactor
This commit is contained in:
@@ -114,6 +114,14 @@ func (s3a *S3ApiServer) CompleteMultipartUploadHandler(w http.ResponseWriter, r
|
||||
return
|
||||
}
|
||||
|
||||
// Check conditional headers before completing multipart upload
|
||||
// This implements AWS S3 behavior where conditional headers apply to CompleteMultipartUpload
|
||||
if errCode := s3a.checkConditionalHeaders(r, bucket, object); errCode != s3err.ErrNone {
|
||||
glog.V(3).Infof("CompleteMultipartUploadHandler: Conditional header check failed for %s/%s", bucket, object)
|
||||
s3err.WriteErrorResponse(w, r, errCode)
|
||||
return
|
||||
}
|
||||
|
||||
response, errCode := s3a.completeMultipartUpload(r, &s3.CompleteMultipartUploadInput{
|
||||
Bucket: aws.String(bucket),
|
||||
Key: objectKey(aws.String(object)),
|
||||
|
||||
Reference in New Issue
Block a user