Merge pull request #172 from versity/fix/issue-152

Issue 152
This commit is contained in:
Ben McClelland
2023-07-28 21:24:39 -07:00
committed by GitHub
3 changed files with 19 additions and 2 deletions
+13
View File
@@ -803,6 +803,19 @@ func TestIncorrectMultiParts(s *S3Conf) {
badEtag := "bogusEtagValue"
// Empty multipart upload
ctx, cancel = context.WithTimeout(context.Background(), shortTimeout)
_, err = s3client.CompleteMultipartUpload(ctx, &s3.CompleteMultipartUploadInput{
Bucket: &bucket,
Key: &obj,
UploadId: mpu.UploadId,
})
cancel()
if err == nil {
failF("%v: complete multipart expected err", testname)
return
}
ctx, cancel = context.WithTimeout(context.Background(), shortTimeout)
_, err = s3client.CompleteMultipartUpload(ctx, &s3.CompleteMultipartUploadInput{
Bucket: &bucket,
+5 -1
View File
@@ -834,7 +834,11 @@ func (c S3ApiController) CreateActions(ctx *fiber.Ctx) error {
}{}
if err := xml.Unmarshal(ctx.Body(), &data); err != nil {
return SendXMLResponse(ctx, nil, err, &MetaOpts{Logger: c.logger, Action: "CompleteMultipartUpload", BucketOwner: parsedAcl.Owner})
return SendXMLResponse(ctx, nil, s3err.GetAPIError(s3err.ErrMalformedXML), &MetaOpts{
Logger: c.logger,
Action: "CompleteMultipartUpload",
BucketOwner: parsedAcl.Owner,
})
}
if err := auth.VerifyACL(parsedAcl, bucket, access, "WRITE", isRoot); err != nil {
+1 -1
View File
@@ -1343,7 +1343,7 @@ func TestS3ApiController_CreateActions(t *testing.T) {
req: httptest.NewRequest(http.MethodPost, "/my-bucket/my-key?uploadId=23423", nil),
},
wantErr: false,
statusCode: 500,
statusCode: 400,
},
{
name: "Complete-multipart-upload-success",