## Summary This PR fixes S3 `DeleteObjects` XML parsing when the request body is pretty-printed (contains indentation/newlines as whitespace text nodes). Although PR #1324 already tried to address this, parsing could still fail with: `InvalidRequest: Bad request: Invalid delete XML query` because non-element nodes were validated but not actually skipped in the parsing loop. ## What changed - In `src/api/s3/delete.rs`: - Properly skip non-element whitespace text nodes while iterating over `<Delete>` children. - Keep rejecting non-whitespace stray text content. - Parse the root `<Delete>` element more robustly by selecting the first element child. ## Tests added New unit tests in `src/api/s3/delete.rs`: - `parse_delete_objects_xml_with_formatting` - pretty-printed valid XML is accepted. - `parse_delete_objects_xml_accepts_compact_valid_xml` - compact valid XML is accepted. - `parse_delete_objects_xml_rejects_non_whitespace_text_node` - compact XML with stray text is rejected. - `parse_delete_objects_xml_rejects_pretty_print_with_stray_text` - pretty-printed XML with stray text is rejected. ## Validation Executed: ```bash cargo test -p garage_api_s3 parse_delete_objects_xml -- --nocapture ``` Result: all parser tests pass. Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1374 Co-authored-by: milouz1985 <francois.hoyez@gmail.com> Co-committed-by: milouz1985 <francois.hoyez@gmail.com>
Garage 
[ Website and documentation | Binary releases | Git repository | Matrix channel ]
Garage is an S3-compatible distributed object storage service designed for self-hosting at a small-to-medium scale.
Garage is designed for storage clusters composed of nodes running at different physical locations, in order to easily provide a storage service that replicates data at these different locations and stays available even when some servers are unreachable. Garage also focuses on being lightweight, easy to operate, and highly resilient to machine failures.
Garage is built by Deuxfleurs, an experimental small-scale self hosted service provider, which has been using it in production since its first release in 2020.
Learn more on our dedicated documentation pages:
Garage is entirely free software released under the terms of the AGPLv3.