scireum / s3ninja

S3 ninja emulates the Amazon S3 API for developement and test purposes
MIT License
493 stars 91 forks source link

Closing a multipart upload without uploading any data does not error out #212

Open idlira opened 2 years ago

idlira commented 2 years ago

I agree, an issue expecting an exception is not common, as most issues should solve exceptions instead! 😉

This issue is just to align a behavior which happens with the real S3:

A multipart upload is started, nothing gets uploaded (no eTags can be submitted to close the multipart upload). Attempting to close the multipart upload should fail, but instead a 0-byte object is created.

Although 0-byte objects are allowed, the upload should fails as the real S3 does, with an exception like this: The XML you provided was not well-formed or did not validate against our published schema (Service: Amazon S3; Status Code: 400; Error Code: MalformedXML; Request ID: ZSWW9F6ZJJ5RFN5P; S3 Extended Request ID: HFsBclc4smPOwDb8aiChFQ3OazbacyVgSR4WLUXiFsoa+riQ3Zu+Zi4hN9cbPUZc4bnclyG8fok=; Proxy: null) (com.amazonaws.services.s3.model.AmazonS3Exception)