+23
−1
Loading
According to AWS S3 API specifications, certain operations require an XML
request body and should return MalformedXML (HTTP 400) when the body is
empty or missing. This commit implements validation for three such operations:
1. CompleteMultipartUpload: Requires XML body with list of uploaded parts
2. PutObjectLegalHold: Requires XML body with LegalHold status (ON/OFF)
3. PutObjectRetention: Requires XML body with retention Mode and RetainUntilDate
The fix is implemented in the code generator (s3s_codegen) to ensure
consistency across both generated.rs and generated_minio.rs files.
Operations with truly optional XML bodies (CreateBucket, PutBucketAcl,
PutObjectAcl, PutBucketLifecycleConfiguration, RestoreObject) are left
unchanged as they can legitimately have empty bodies when using alternative
request methods (e.g., canned ACLs via headers, default region creation).
Signed-off-by:
Kefu Chai <tchaikov@gmail.com>