diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2021-05-14 22:33:26 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2021-05-14 22:33:26 +0200 |
commit | 5fdabf3e75ba16b5ceed99edb1912cb001765d03 (patch) | |
tree | d9288733c910cfac9217668b0d9b8360d72ab4e8 /src/api/s3_bucket.rs | |
parent | 6ccffc316228bb056fa135cc5fceb2ed75f545f5 (diff) | |
download | garage-5fdabf3e75ba16b5ceed99edb1912cb001765d03.tar.gz garage-5fdabf3e75ba16b5ceed99edb1912cb001765d03.zip |
Add basic support for the "Versioning" command
Diffstat (limited to 'src/api/s3_bucket.rs')
-rw-r--r-- | src/api/s3_bucket.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/api/s3_bucket.rs b/src/api/s3_bucket.rs index 88d13cac..c8bbc51b 100644 --- a/src/api/s3_bucket.rs +++ b/src/api/s3_bucket.rs @@ -21,6 +21,19 @@ pub fn handle_get_bucket_location(garage: Arc<Garage>) -> Result<Response<Body>, .body(Body::from(xml.into_bytes()))?) } +pub fn handle_get_bucket_versioning() -> Result<Response<Body>, Error> { + let versioning = s3_xml::VersioningConfiguration { + xmlns: (), + status: None, + }; + + let xml = s3_xml::to_xml_with_header(&versioning)?; + + Ok(Response::builder() + .header("Content-Type", "application/xml") + .body(Body::from(xml.into_bytes()))?) +} + pub fn handle_list_buckets(api_key: &Key) -> Result<Response<Body>, Error> { let list_buckets = s3_xml::ListAllMyBucketsResult { owner: s3_xml::Owner { |